restore stderr logging for main error

This commit is contained in:
Jonathan Shook 2020-07-20 23:38:43 -05:00
parent 3874b3650c
commit 8e172544f1
2 changed files with 4 additions and 3 deletions

View File

@ -54,8 +54,9 @@ public class NBCLI {
} catch (Exception e) {
String error = ScenarioErrorHandler.handle(e,true);
if (error!=null) {
System.out.println(error);
System.err.println(error);
}
System.err.flush();
System.out.flush();
System.exit(2);
}
@ -325,7 +326,7 @@ public class NBCLI {
Exception exception = scenariosResults.getOne().getException().get();
// logger.warn(scenariosResults.getExecutionSummary());
ScenarioErrorHandler.handle(exception,options.wantsStackTraces());
System.out.println(exception.getMessage()); // TODO: make this consistent with ConsoleLogging sequencing
System.err.println(exception.getMessage()); // TODO: make this consistent with ConsoleLogging sequencing
System.exit(2);
} else {
logger.info(scenariosResults.getExecutionSummary());

View File

@ -40,7 +40,7 @@ public class ExitStatusIntegrationTests {
);
String stderr = result.getStderrData().stream().collect(Collectors.joining("\n"));
assertThat(stderr).contains("unrecognized option:badparam");
assertThat(result.exitStatus).isEqualTo(1);
assertThat(result.exitStatus).isEqualTo(2);
}
@Test