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

@ -221,8 +221,17 @@ public class Bootstrap {
keepAliveLatch.countDown(); keepAliveLatch.countDown();
} }
} }
/** 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 main(String[] args) throws Throwable { public static void doMain(String[] args) throws Throwable {
BootstrapCLIParser bootstrapCLIParser = new BootstrapCLIParser(); BootstrapCLIParser bootstrapCLIParser = new BootstrapCLIParser();
CliTool.ExitStatus status = bootstrapCLIParser.execute(args); CliTool.ExitStatus status = bootstrapCLIParser.execute(args);
@ -291,7 +300,7 @@ public class Bootstrap {
Loggers.enableConsoleLogging(); Loggers.enableConsoleLogging();
} }
throw new StartupError(e); throw e;
} }
} }