Skip to content

Commit 25d249c

Browse files
committed
Exclude ExitRequest from error handling
- Don't try to handle ExitRequest exception with error handling so that we're able to break out from a run loop with interactive shell. - Fixes #624
1 parent 90010a9 commit 25d249c

File tree

1 file changed

+1
-1
lines changed
  • spring-shell-core/src/main/java/org/springframework/shell

1 file changed

+1
-1
lines changed

spring-shell-core/src/main/java/org/springframework/shell/Shell.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ protected Object evaluate(Input input) {
265265
finally {
266266
Signals.unregister("INT", sh);
267267
}
268-
if (e != null) {
268+
if (e != null && !(e instanceof ExitRequest)) {
269269
try {
270270
CommandHandlingResult processException = processException(commandExceptionResolvers, e);
271271
processExceptionNonInt = processException;

0 commit comments

Comments
 (0)