Skip to content

Commit

Permalink
Display error for unsupported actions
Browse files Browse the repository at this point in the history
  • Loading branch information
justinmclean committed Nov 12, 2024
1 parent 764054b commit 315599a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,5 @@ public class ErrorMessages {
"Unsupported combination of options either use --name or --property.";
public static final String INVALID_OWNER_COMMAND =
"Unsupported combination of options either use --user or --group.";
public static final String UNSUPPORTED_ACTION = "Entity doesn't support this action.";
}
Original file line number Diff line number Diff line change
Expand Up @@ -370,6 +370,8 @@ protected void handleUserCommand() {
} else if (CommandActions.DELETE.equals(command)) {
boolean force = line.hasOption(GravitinoOptions.FORCE);
new DeleteUser(url, ignore, force, metalake, user).handle();
} else {
System.err.println(ErrorMessages.UNSUPPORTED_ACTION);
}
}

Expand All @@ -389,6 +391,8 @@ protected void handleGroupCommand() {
} else if (CommandActions.DELETE.equals(command)) {
boolean force = line.hasOption(GravitinoOptions.FORCE);
new DeleteGroup(url, ignore, force, metalake, group).handle();
} else {
System.err.println(ErrorMessages.UNSUPPORTED_ACTION);
}
}

Expand Down Expand Up @@ -485,6 +489,8 @@ private void handleOwnerCommand() {
} else {
System.err.println(ErrorMessages.INVALID_OWNER_COMMAND);
}
} else {
System.err.println(ErrorMessages.UNSUPPORTED_ACTION);
}
}

Expand Down

0 comments on commit 315599a

Please sign in to comment.