Browse Source

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

Add exit code to CLI failure termination message, to help with loopy diagnosis.
Chris Hegarty 2 years ago
parent
commit
bdd38c6876
1 changed files with 1 additions and 1 deletions
  1. 1 1
      libs/cli/src/main/java/org/elasticsearch/cli/Command.java

+ 1 - 1
libs/cli/src/main/java/org/elasticsearch/cli/Command.java

@@ -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);
         }
     }