fix for error handler NPE

This commit is contained in:
Jonathan Shook 2020-07-16 10:40:47 -05:00
parent 99f15f90ba
commit b53c9c6e4e
2 changed files with 4 additions and 2 deletions

View File

@ -321,9 +321,11 @@ public class NBCLI {
ShutdownManager.shutdown();
if (scenariosResults.hasError()) {
logger.info(scenariosResults.getExecutionSummary());
logger.warn(scenariosResults.getExecutionSummary());
logger.error("error running scenario:",scenariosResults.getOne().getException().get());
System.exit(2);
} else {
logger.info(scenariosResults.getExecutionSummary());
System.exit(0);
}
}

View File

@ -40,7 +40,7 @@ public class ScenarioErrorHandler {
private static void handleInternalError(Exception e, boolean wantsStackTraces) {
String prefix = "internal error: ";
if (!e.getCause().getClass().getCanonicalName().contains("io.nosqlbench")) {
if (e.getCause()!=null && !e.getCause().getClass().getCanonicalName().contains("io.nosqlbench")) {
prefix = "Error from driver or included library: ";
}