justinmclean commented on code in PR #5793:
URL: https://github.com/apache/gravitino/pull/5793#discussion_r1881335451


##########
clients/client-java/src/main/java/org/apache/gravitino/client/ErrorHandlers.java:
##########
@@ -858,6 +868,43 @@ public void accept(ErrorResponse errorResponse) {
     }
   }
 
+  /** Error handler specific to Credential operations. */
+  @SuppressWarnings("FormatStringAnnotation")
+  private static class CredentialErrorHandler extends RestErrorHandler {
+
+    private static final CredentialErrorHandler INSTANCE = new 
CredentialErrorHandler();
+
+    @Override
+    public void accept(ErrorResponse errorResponse) {
+      String errorMessage = formatErrorMessage(errorResponse);
+
+      switch (errorResponse.getCode()) {
+        case ErrorConstants.ILLEGAL_ARGUMENTS_CODE:
+          throw new IllegalArgumentException(errorMessage);
+
+        case ErrorConstants.NOT_FOUND_CODE:
+          if 
(errorResponse.getType().equals(NoSuchMetalakeException.class.getSimpleName())) 
{
+            throw new NoSuchMetalakeException(errorMessage);
+          } else if (errorResponse

Review Comment:
   This is out of scope of this PR as it's outside the CLI code or any changes 
made by this PR.  Best to raise a new issue for it.



-- 
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]

Reply via email to