Skip to content

Commit

Permalink
#844: ensure logging is enabled on error or invalid CLI (#845)
Browse files Browse the repository at this point in the history
  • Loading branch information
hohwille authored Dec 5, 2024
1 parent 8434a0e commit a1d4df4
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -802,18 +802,19 @@ public int run(CliArguments arguments) {
return ProcessResult.SUCCESS;
}
}
this.startContext.activateLogging();
if (result != null) {
error(result.getErrorMessage());
}
step.error("Invalid arguments: {}", current.getArgs());

HelpCommandlet help = this.commandletManager.getCommandlet(HelpCommandlet.class);
if (cmd != null) {
help.commandlet.setValue(cmd);
}
help.run();
return 1;
} catch (Throwable t) {
this.startContext.activateLogging();
step.error(t, true);
throw t;
} finally {
Expand Down

0 comments on commit a1d4df4

Please sign in to comment.