From 4e3a1772f64ba64508baea084d49b1e2a6eb7803 Mon Sep 17 00:00:00 2001 From: Gilles Duboscq Date: Fri, 2 Feb 2018 14:44:57 +0100 Subject: [PATCH] Polyglot shell: use AbortException instead of System.exit --- .../src/org/graalvm/launcher/MultiLanguageShell.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/sdk/src/org.graalvm.launcher/src/org/graalvm/launcher/MultiLanguageShell.java b/sdk/src/org.graalvm.launcher/src/org/graalvm/launcher/MultiLanguageShell.java index e337446d35ea..79b3d2377839 100644 --- a/sdk/src/org.graalvm.launcher/src/org/graalvm/launcher/MultiLanguageShell.java +++ b/sdk/src/org.graalvm.launcher/src/org/graalvm/launcher/MultiLanguageShell.java @@ -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); @@ -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;