Updated logging for cli errors relating to org.apache.commons.cli.ParseException

This commit is contained in:
Collin Smith 2020-11-27 02:21:41 -08:00
parent 495dbefa9f
commit d847297032

View File

@ -30,7 +30,12 @@ public class Tool implements ApplicationListener {
}
protected void handleCliError(String cmd, Options options, Throwable t) {
log.error(t.getMessage(), t);
if (t instanceof ParseException) {
log.debug(t.getMessage(), t);
} else {
log.fatal(t.getMessage(), t);
}
System.out.println(ExceptionUtils.getRootCauseMessage(t));
printHelp(cmd, options);
System.exit(0);