public interface ErrorResponse
The response in case of an error.
ErrorResponse errorResponse = ErrorResponse.builder()
.statusCode(1)
.message("{message}")
.build()
Modifier and Type | Method and Description |
---|---|
static ErrorResponseBuilder |
builder() |
static ErrorResponseBuilder |
builder(ErrorResponse template) |
String |
getError()
This property is only used for OAuth2 errors.
|
String |
getErrorDescription()
This property is only used for OAuth2 errors.
|
@Valid List<ErrorObject> |
getErrors()
The errors that caused this error response.
|
@NotNull String |
getMessage()
Describes the error.
|
@NotNull Integer |
getStatusCode()
The http status code of the response.
|
static ErrorResponse |
of() |
static ErrorResponse |
of(ErrorResponse template) |
void |
setError(String error) |
void |
setErrorDescription(String errorDescription) |
void |
setErrors(ErrorObject... errors) |
void |
setErrors(List<ErrorObject> errors) |
void |
setMessage(String message) |
void |
setStatusCode(Integer statusCode) |
static com.fasterxml.jackson.core.type.TypeReference<ErrorResponse> |
typeReference() |
default <T> T |
withErrorResponse(Function<ErrorResponse,T> helper) |
@NotNull @NotNull Integer getStatusCode()
The http status code of the response.
@NotNull @NotNull String getMessage()
Describes the error.
String getError()
This property is only used for OAuth2 errors. Contains the error code.
String getErrorDescription()
This property is only used for OAuth2 errors. Additional information to assist the client developer in understanding the error.
@Valid @Valid List<ErrorObject> getErrors()
The errors that caused this error response.
void setStatusCode(Integer statusCode)
void setMessage(String message)
void setError(String error)
void setErrorDescription(String errorDescription)
void setErrors(ErrorObject... errors)
void setErrors(List<ErrorObject> errors)
static ErrorResponse of()
static ErrorResponse of(ErrorResponse template)
static ErrorResponseBuilder builder()
static ErrorResponseBuilder builder(ErrorResponse template)
default <T> T withErrorResponse(Function<ErrorResponse,T> helper)
static com.fasterxml.jackson.core.type.TypeReference<ErrorResponse> typeReference()