sreejasahithi commented on code in PR #10058:
URL: https://github.com/apache/ozone/pull/10058#discussion_r3077341490


##########
hadoop-ozone/cli-admin/src/main/java/org/apache/hadoop/hdds/scm/cli/datanode/ListInfoSubcommand.java:
##########
@@ -90,6 +90,12 @@ static class ExclusiveNodeOptions extends NodeSelectionMixin 
{
 
   @Override
   public void execute(ScmClient scmClient) throws IOException {
+    if (nodeWithFailedVolumes && exclusiveNodeOptions != null
+        && !Strings.isNullOrEmpty(exclusiveNodeOptions.getNodeId())) {
+      throw new IOException(
+          "--nodes-with-failed-volumes cannot be used with --id/--node-id. "
+          + "Use them separately.");
+    }

Review Comment:
   Picocli reports argument conflicts as 
CommandLine.MutuallyExclusiveArgsException (a subclass of 
CommandLine.ParameterException). Throwing IOException from execute() bypasses 
picocli's error handling entirely, producing a different error format than what 
the user would see from other mutual-exclusion violations. so change this to 
throw new CommandLine.ParameterException.
   
   (you can refer to DecommissionStatusSubCommand to see how it can be used.)



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to