You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by GitBox <gi...@apache.org> on 2022/06/17 03:57:50 UTC

[GitHub] [ozone] rakeshadr commented on a diff in pull request #3517: HDDS-6882. Correct exit code for invalid arguments passed to command-line tools.

rakeshadr commented on code in PR #3517:
URL: https://github.com/apache/ozone/pull/3517#discussion_r899741257


##########
hadoop-hdds/common/src/main/java/org/apache/hadoop/hdds/cli/GenericCli.java:
##########
@@ -52,6 +53,10 @@ public class GenericCli implements Callable<Void>, GenericParentCommand {
 
   public GenericCli() {
     cmd = new CommandLine(this);
+    cmd.setExecutionExceptionHandler((ex, commandLine, parseResult) -> {
+      printError(ex);

Review Comment:
   Thanks @duongnguyen0 for the contribution. Overall patch looks nice.
   
   Existing  [GenericCli.java#L88](https://github.com/apache/ozone/blob/master/hadoop-hdds/common/src/main/java/org/apache/hadoop/hdds/cli/GenericCli.java#L88) `printError()` function is using the exception cause, if its not null. Could you please check the print message in your patch and whether its printing all the necessary info.
   `printError(ex.getCause() == null ? ex : ex.getCause());`



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org