52938
|
1 |
/*
|
|
2 |
* Copyright (c) 2002-2016, the original author or authors.
|
|
3 |
*
|
|
4 |
* This software is distributable under the BSD license. See the terms of the
|
|
5 |
* BSD license in the documentation provided with this software.
|
|
6 |
*
|
58903
|
7 |
* https://opensource.org/licenses/BSD-3-Clause
|
52938
|
8 |
*/
|
|
9 |
package jdk.internal.org.jline.reader;
|
|
10 |
|
|
11 |
/**
|
|
12 |
* This exception is thrown by {@link LineReader#readLine} when
|
|
13 |
* user interrupt handling is enabled and the user types the
|
|
14 |
* interrupt character (ctrl-C). The partially entered line is
|
|
15 |
* available via the {@link #getPartialLine()} method.
|
|
16 |
*/
|
|
17 |
public class UserInterruptException
|
|
18 |
extends RuntimeException
|
|
19 |
{
|
|
20 |
private static final long serialVersionUID = 6172232572140736750L;
|
|
21 |
|
|
22 |
private final String partialLine;
|
|
23 |
|
|
24 |
public UserInterruptException(String partialLine)
|
|
25 |
{
|
|
26 |
this.partialLine = partialLine;
|
|
27 |
}
|
|
28 |
|
|
29 |
/**
|
|
30 |
* @return the partially entered line when ctrl-C was pressed
|
|
31 |
*/
|
|
32 |
public String getPartialLine()
|
|
33 |
{
|
|
34 |
return partialLine;
|
|
35 |
}
|
|
36 |
}
|