mirror of
https://github.com/nosqlbench/nosqlbench.git
synced 2025-01-13 09:22:05 -06:00
restore main error output
This commit is contained in:
parent
a05c95d26f
commit
f4d94e282b
@ -321,8 +321,9 @@ public class NBCLI {
|
||||
ShutdownManager.shutdown();
|
||||
|
||||
if (scenariosResults.hasError()) {
|
||||
logger.warn(scenariosResults.getExecutionSummary());
|
||||
logger.error("error running scenario:",scenariosResults.getOne().getException().get());
|
||||
Exception exception = scenariosResults.getOne().getException().get();
|
||||
// logger.warn(scenariosResults.getExecutionSummary());
|
||||
ScenarioErrorHandler.handle(exception,options.wantsStackTraces());
|
||||
System.exit(2);
|
||||
} else {
|
||||
logger.info(scenariosResults.getExecutionSummary());
|
||||
|
@ -28,9 +28,9 @@ public class ScenarioErrorHandler {
|
||||
|
||||
private final static Logger logger = LoggerFactory.getLogger(ScenarioErrorHandler.class);
|
||||
|
||||
public static void handle(String script, Throwable t, boolean wantsStackTraces) {
|
||||
public static void handle(Throwable t, boolean wantsStackTraces) {
|
||||
if (t instanceof ScriptException) {
|
||||
handleScriptException(script, (ScriptException) t, wantsStackTraces);
|
||||
handleScriptException((ScriptException) t, wantsStackTraces);
|
||||
} else if (t instanceof BasicError) {
|
||||
handleBasicError((BasicError) t, wantsStackTraces);
|
||||
} else if (t instanceof Exception){
|
||||
@ -52,14 +52,14 @@ public class ScenarioErrorHandler {
|
||||
}
|
||||
}
|
||||
|
||||
private static void handleScriptException(String script, ScriptException e, boolean wantsStackTraces) {
|
||||
private static void handleScriptException(ScriptException e, boolean wantsStackTraces) {
|
||||
Throwable cause = e.getCause();
|
||||
if (cause instanceof PolyglotException) {
|
||||
Throwable hostException = ((PolyglotException) cause).asHostException();
|
||||
if (hostException instanceof BasicError) {
|
||||
handleBasicError((BasicError)hostException, wantsStackTraces);
|
||||
} else {
|
||||
handle(script,hostException, wantsStackTraces);
|
||||
handle(hostException, wantsStackTraces);
|
||||
}
|
||||
} else {
|
||||
if (wantsStackTraces) {
|
||||
|
@ -217,10 +217,8 @@ public class Scenario implements Callable<ScenarioResult> {
|
||||
System.err.flush();
|
||||
System.out.flush();
|
||||
} catch (Exception e) {
|
||||
ScenarioErrorHandler.handle(script,e,wantsStackTraces);
|
||||
throw new RuntimeException(e);
|
||||
} finally {
|
||||
scenarioController.forceStopScenario(5000);
|
||||
System.out.flush();
|
||||
System.err.flush();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user