Skip to content

Commit

Permalink
Polyglot shell: use AbortException instead of System.exit
Browse files Browse the repository at this point in the history
  • Loading branch information
gilles-duboscq committed Feb 2, 2018
1 parent 2c363d8 commit 4e3a177
Showing 1 changed file with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,7 @@ public int readEvalPrint() throws IOException {
}

if (languages.isEmpty()) {
console.println("Error: No Graal languages installed. Exiting shell.");
System.exit(1);
throw new Launcher.AbortException("Error: No Graal languages installed. Exiting shell.", 1);
}

printUsage(console, promptsString, false);
Expand All @@ -108,8 +107,7 @@ public int readEvalPrint() throws IOException {

Language currentLanguage = context.getEngine().getLanguages().get(startLanguage);
if (currentLanguage == null) {
console.println("Error: could not find language '" + startLanguage + "'");
System.exit(1);
throw new Launcher.AbortException("Error: could not find language '" + startLanguage + "'", 1);
}
assert languages.indexOf(currentLanguage) >= 0;
Source bufferSource = null;
Expand Down

0 comments on commit 4e3a177

Please sign in to comment.