Use StartupError to format all exceptions hitting the console

This commit is contained in:
Robert Muir 2015-08-21 11:05:31 -04:00
parent d0835715c2
commit 287789be53
1 changed files with 11 additions and 2 deletions

View File

@ -222,7 +222,16 @@ public class Bootstrap {
}
}
public static void main(String[] args) throws Throwable {
/** Calls doMain(), but with special formatting of errors */
public static void main(String[] args) throws StartupError {
try {
doMain(args);
} catch (Throwable t) {
throw new StartupError(t);
}
}
public static void doMain(String[] args) throws Throwable {
BootstrapCLIParser bootstrapCLIParser = new BootstrapCLIParser();
CliTool.ExitStatus status = bootstrapCLIParser.execute(args);
@ -291,7 +300,7 @@ public class Bootstrap {
Loggers.enableConsoleLogging();
}
throw new StartupError(e);
throw e;
}
}