Merge pull request #13041 from rmuir/consistent_formatting

Use StartupError to format all exceptions hitting the console
This commit is contained in:
Robert Muir 2015-08-21 11:09:02 -04:00
commit 2ecf9af71d
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;
}
}