adoroszlai commented on code in PR #10160:
URL: https://github.com/apache/ozone/pull/10160#discussion_r3200334686
##########
hadoop-hdds/cli-common/src/main/java/org/apache/hadoop/hdds/cli/GenericCli.java:
##########
@@ -88,19 +89,22 @@ public int execute(String[] argv) {
@Override
public void printError(Throwable error) {
- //message could be null in case of NPE. This is unexpected so we can
- //print out the stack trace.
final String rawMessage = error.getMessage();
if (verbose || rawMessage == null || rawMessage.isEmpty()) {
error.printStackTrace(cmd.getErr());
- } else {
- if (error instanceof FileSystemException) {
- String errorMessage = handleFileSystemException((FileSystemException)
error);
- cmd.getErr().println(errorMessage);
- } else {
- cmd.getErr().println(rawMessage.split("\n")[0]);
- }
+ return;
+ }
+ String aclLine = HddsUtils.formatAccessControlExceptionLine(error);
+ if (aclLine != null) {
+ cmd.getErr().println(aclLine);
+ return;
Review Comment:
Would it make sense to `ExitUtils.terminate` here? This would make complex
logic (for exiting loops) in various subcommands unnecessary.
--
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]