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 ErrorResponse
alreadyExists
(String type, String message) Create a new already exists error instance ofErrorResponse
.static ErrorResponse
alreadyExists
(String type, String message, Throwable throwable) Create a new already exists error instance ofErrorResponse
.static ErrorResponse
connectionFailed
(String message) Create a new connection failed error instance ofErrorResponse
.static ErrorResponse
connectionFailed
(String message, Throwable throwable) Create a new connection failed error instance ofErrorResponse
.static ErrorResponse
Create a new forbidden operation error instance ofErrorResponse
.static ErrorResponse
illegalArguments
(String message) Create a new illegal arguments error instance ofErrorResponse
.static ErrorResponse
illegalArguments
(String type, String message, Throwable throwable) Create a new illegal arguments error instance ofErrorResponse
.static ErrorResponse
illegalArguments
(String message, Throwable throwable) Create a new illegal arguments error instance ofErrorResponse
.static ErrorResponse
internalError
(String message) Create a new internal error instance ofErrorResponse
.static ErrorResponse
internalError
(String message, Throwable throwable) Create a new internal error instance ofErrorResponse
.static ErrorResponse
Create a new entity in use error instance ofErrorResponse
.static ErrorResponse
Create a new non-empty error instance ofErrorResponse
.static ErrorResponse
Create a new non-empty error instance ofErrorResponse
.static ErrorResponse
Create a new not found error instance ofErrorResponse
.static ErrorResponse
Create a new not found error instance ofErrorResponse
.static ErrorResponse
Create a new not in use error instance ofErrorResponse
.static ErrorResponse
oauthError
(int code, String type, String message) Create a new oauth error instance ofErrorResponse
.static ErrorResponse
Creates a new rest error instance ofErrorResponse
.toString()
static ErrorResponse
unknownError
(String message) Create a new unknown error instance ofErrorResponse
.static ErrorResponse
unsupportedOperation
(String message) Create a new unsupported operation error instance ofErrorResponse
.static ErrorResponse
unsupportedOperation
(String message, Throwable throwable) Create a new unsupported operation error instance ofErrorResponse
.void
validate()
Validates the error response.
-
Method Details
-
validate
public void validate()Validates the error response.- Specified by:
validate
in interfaceRESTMessage
- Overrides:
validate
in 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.
-