diff options
Diffstat (limited to 'src/main/FarmShell.java')
-rw-r--r-- | src/main/FarmShell.java | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/main/FarmShell.java b/src/main/FarmShell.java index 3c6f17f..7186c2f 100644 --- a/src/main/FarmShell.java +++ b/src/main/FarmShell.java @@ -64,8 +64,6 @@ public class FarmShell { // print prompt for reading next line printPrompt(); } - // prevent corrupted compressed files when exiting without a command - throw new NoSuchElementException(); } /** @@ -102,8 +100,13 @@ public class FarmShell { System.err.println("Command " + args[0] + " failed with " + ex); ex.printStackTrace(); } catch (NoSuchElementException ex) { - // thrown by the "exit" command to signal exit - return false; + if ("EXIT NOW".equals(ex.getMessage())) { + // thrown by the "exit" command to signal exit + return false; + } else { + System.err.println("ZOMG SOMETHIGN FAILED: " + ex.getMessage()); + ex.printStackTrace(); + } } catch (SQLException ex) { System.err.println("such " + ex); } @@ -145,7 +148,7 @@ public class FarmShell { } break; case exit: - throw new NoSuchElementException(); + throw new NoSuchElementException("EXIT NOW"); default: throw new AssertionError(command.name()); } |