Add exit code to CLI failure termination message (#97004)

Add exit code to CLI failure termination message, to help with loopy diagnosis.
This commit is contained in:
Chris Hegarty 2023-06-22 11:56:16 +01:00 committed by GitHub
parent c9e37ef7c5
commit bdd38c6876
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -114,7 +114,7 @@ public abstract class Command implements Closeable {
protected void printUserException(Terminal terminal, UserException e) {
if (e.getMessage() != null) {
terminal.errorPrintln("");
terminal.errorPrintln(Terminal.Verbosity.SILENT, "ERROR: " + e.getMessage());
terminal.errorPrintln(Terminal.Verbosity.SILENT, "ERROR: " + e.getMessage() + ", with exit code " + e.exitCode);
}
}