Class ErrorHandlers.OAuthErrorHandler

java.lang.Object
org.apache.gravitino.client.ErrorHandler
org.apache.gravitino.client.ErrorHandlers.OAuthErrorHandler
All Implemented Interfaces:
Consumer<ErrorResponse>
Enclosing class:
ErrorHandlers

public static class ErrorHandlers.OAuthErrorHandler extends ErrorHandler
Error handler specific to OAuth2 requests.
  • Constructor Details

    • OAuthErrorHandler

      public OAuthErrorHandler()
  • Method Details

    • parseResponse

      public ErrorResponse parseResponse(int code, String json, com.fasterxml.jackson.databind.ObjectMapper mapper)
      Parses the error response from the server.
      Parameters:
      code - The response code indicating the error status.
      json - The JSON data representing the error response.
      mapper - The ObjectMapper used to deserialize the JSON data.
      Returns:
      An ErrorResponse object representing the error response.
    • accept

      public void accept(ErrorResponse errorResponse)
      Accepts the error response and throws an exception based on the error type.
      Specified by:
      accept in interface Consumer<ErrorResponse>
      Parameters:
      errorResponse - the input argument