Class ErrorResponse
java.lang.Object
org.apache.gravitino.dto.responses.BaseResponse
org.apache.gravitino.dto.responses.ErrorResponse
- All Implemented Interfaces:
RESTMessage,RESTResponse
Represents an error response.
-
Method Summary
Modifier and TypeMethodDescriptionstatic ErrorResponsealreadyExists(String type, String message) Create a new already exists error instance ofErrorResponse.static ErrorResponsealreadyExists(String type, String message, Throwable throwable) Create a new already exists error instance ofErrorResponse.static ErrorResponseconnectionFailed(String message) Create a new connection failed error instance ofErrorResponse.static ErrorResponseconnectionFailed(String message, Throwable throwable) Create a new connection failed error instance ofErrorResponse.static ErrorResponseCreate a new forbidden operation error instance ofErrorResponse.static ErrorResponseillegalArguments(String message) Create a new illegal arguments error instance ofErrorResponse.static ErrorResponseillegalArguments(String type, String message, Throwable throwable) Create a new illegal arguments error instance ofErrorResponse.static ErrorResponseillegalArguments(String message, Throwable throwable) Create a new illegal arguments error instance ofErrorResponse.static ErrorResponseinternalError(String message) Create a new internal error instance ofErrorResponse.static ErrorResponseinternalError(String message, Throwable throwable) Create a new internal error instance ofErrorResponse.static ErrorResponseCreate a new entity in use error instance ofErrorResponse.static ErrorResponseCreate a new non-empty error instance ofErrorResponse.static ErrorResponseCreate a new non-empty error instance ofErrorResponse.static ErrorResponseCreate a new not found error instance ofErrorResponse.static ErrorResponseCreate a new not found error instance ofErrorResponse.static ErrorResponseCreate a new not in use error instance ofErrorResponse.static ErrorResponseoauthError(int code, String type, String message) Create a new oauth error instance ofErrorResponse.static ErrorResponseCreates a new rest error instance ofErrorResponse.toString()static ErrorResponseunknownError(String message) Create a new unknown error instance ofErrorResponse.static ErrorResponseunsupportedOperation(String message) Create a new unsupported operation error instance ofErrorResponse.static ErrorResponseunsupportedOperation(String message, Throwable throwable) Create a new unsupported operation error instance ofErrorResponse.voidvalidate()Validates the error response.
-
Method Details
-
validate
public void validate()Validates the error response.- Specified by:
validatein interfaceRESTMessage- Overrides:
validatein classBaseResponse
-
toString
-
restError
Creates a new rest error instance ofErrorResponse.- Parameters:
message- The message of the error.- Returns:
- The new instance.
-
illegalArguments
Create a new illegal arguments error instance ofErrorResponse.- Parameters:
message- The message of the error.- Returns:
- The new instance.
-
illegalArguments
Create a new illegal arguments error instance ofErrorResponse.- Parameters:
message- The message of the error.throwable- The throwable that caused the error.- Returns:
- The new instance.
-
illegalArguments
Create a new illegal arguments error instance ofErrorResponse.- Parameters:
type- The type of the error.message- The message of the error.throwable- The throwable that caused the error.- Returns:
- The new instance.
-
connectionFailed
Create a new connection failed error instance ofErrorResponse.- Parameters:
message- The message of the error.- Returns:
- The new instance.
-
connectionFailed
Create a new connection failed error instance ofErrorResponse.- Parameters:
message- The message of the error.throwable- The throwable that caused the error.- Returns:
- The new instance.
-
notFound
Create a new not found error instance ofErrorResponse.- Parameters:
type- The type of the error.message- The message of the error.- Returns:
- The new instance.
-
notFound
Create a new not found error instance ofErrorResponse.- Parameters:
type- The type of the error.message- The message of the error.throwable- The throwable that caused the error.- Returns:
- The new instance.
-
internalError
Create a new internal error instance ofErrorResponse.- Parameters:
message- The message of the error.- Returns:
- The new instance.
-
internalError
Create a new internal error instance ofErrorResponse.- Parameters:
message- The message of the error.throwable- The throwable that caused the error.- Returns:
- The new instance.
-
alreadyExists
Create a new already exists error instance ofErrorResponse.- Parameters:
type- The type of the error.message- The message of the error.- Returns:
- The new instance.
-
alreadyExists
Create a new already exists error instance ofErrorResponse.- Parameters:
type- The type of the error.message- The message of the error.throwable- The throwable that caused the error.- Returns:
- The new instance.
-
notInUse
Create a new not in use error instance ofErrorResponse.- Parameters:
type- The type of the error.message- The message of the error.throwable- The throwable that caused the error.- Returns:
- The new instance.
-
inUse
Create a new entity in use error instance ofErrorResponse.- Parameters:
type- The type of the error.message- The message of the error.throwable- The throwable that caused the error.- Returns:
- The new instance.
-
nonEmpty
Create a new non-empty error instance ofErrorResponse.- Parameters:
type- The type of the error.message- The message of the error.- Returns:
- The new instance.
-
nonEmpty
Create a new non-empty error instance ofErrorResponse.- Parameters:
type- The type of the error.message- The message of the error.throwable- The throwable that caused the error.- Returns:
- The new instance.
-
unknownError
Create a new unknown error instance ofErrorResponse.- Parameters:
message- The message of the error.- Returns:
- The new instance.
-
oauthError
Create a new oauth error instance ofErrorResponse.- Parameters:
code- The code of the error.type- The type of the error.message- The message of the error.- Returns:
- The new instance.
-
unsupportedOperation
Create a new unsupported operation error instance ofErrorResponse.- Parameters:
message- The message of the error.- Returns:
- The new instance.
-
unsupportedOperation
Create a new unsupported operation error instance ofErrorResponse.- Parameters:
message- The message of the error.throwable- The throwable that caused the error.- Returns:
- The new instance.
-
forbidden
Create a new forbidden operation error instance ofErrorResponse.- Parameters:
message- The message of the error.throwable- The throwable that caused the error.- Returns:
- The new instance.
-