Package org.apache.gravitino.client
Class ErrorHandler
java.lang.Object
org.apache.gravitino.client.ErrorHandler
- All Implemented Interfaces:
Consumer<ErrorResponse>
- Direct Known Subclasses:
ErrorHandlers.OAuthErrorHandler
The ErrorHandler class is an abstract class specialized for handling ErrorResponse objects.
Subclasses of ErrorHandler must implement the parseResponse method to provide custom parsing
logic for different types of errors.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract ErrorResponse
parseResponse
(int code, String json, com.fasterxml.jackson.databind.ObjectMapper mapper) Parses the response and creates an ErrorResponse object based on the response code and the JSON data using the provided ObjectMapper.
-
Constructor Details
-
ErrorHandler
public ErrorHandler()
-
-
Method Details
-
parseResponse
public abstract ErrorResponse parseResponse(int code, String json, com.fasterxml.jackson.databind.ObjectMapper mapper) Parses the response and creates an ErrorResponse object based on the response code and the JSON data using the provided ObjectMapper.- 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:
- The ErrorResponse object representing the parsed error response.
-