Package org.apache.gravitino.client
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
Error handler specific to OAuth2 requests.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
accept
(ErrorResponse errorResponse) Accepts the error response and throws an exception based on the error type.parseResponse
(int code, String json, com.fasterxml.jackson.databind.ObjectMapper mapper) Parses the error response from the server.
-
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
Accepts the error response and throws an exception based on the error type.- Specified by:
accept
in interfaceConsumer<ErrorResponse>
- Parameters:
errorResponse
- the input argument
-