RuntimeException that implements ErrorResponse to expose
an HTTP status, response headers, and a body formatted as an RFC 7807
ProblemDetail.
The exception can be used as is, or it can be extended as a more specific
exception that populates the type or
detail fields, or potentially adds
other non-standard properties.
| Modifier and Type | Field and Description |
|---|---|
| private final ProblemDetail | |
| private final HttpHeaders | |
| private final Object[] | |
| private final String | |
| private final HttpStatusCode |
| Access | Constructor and Description |
|---|---|
| public | |
| public | ErrorResponseException(HttpStatusCode status, Throwable cause)
Constructor with an |
| public | ErrorResponseException(HttpStatusCode status, ProblemDetail body, Throwable cause)
Constructor with a given |
| public | ErrorResponseException(HttpStatusCode status, ProblemDetail body, Throwable cause, String messageDetailCode, Object[] messageDetailArguments)
Constructor with a given |
| Modifier and Type | Method and Description |
|---|---|
| public final ProblemDetail | getBody()
Implements org. |
| public Object[] | getDetailMessageArguments()
Overrides default org. message code to resolve the problem "detail" for this exception
through a MessageSource.
|
| public String | getDetailMessageCode()
Overrides default org. MessageSource.
|
| public HttpHeaders | getHeaders()
Overrides default org. |
| public String | getMessage()
Overrides java. |
| public HttpStatusCode | getStatusCode()
Implements org. |
| private String | |
| public void | |
| public void | |
| public void | |
| public void |
| body | back to summary |
|---|---|
| private final ProblemDetail body | |
| headers | back to summary |
|---|---|
| private final HttpHeaders headers | |
| messageDetailArguments | back to summary |
|---|---|
| private final Object[] messageDetailArguments
| |
| messageDetailCode | back to summary |
|---|---|
| private final String messageDetailCode | |
| status | back to summary |
|---|---|
| private final HttpStatusCode status | |
| ErrorResponseException | back to summary |
|---|---|
| public ErrorResponseException(HttpStatusCode status) Constructor with an | |
| ErrorResponseException | back to summary |
|---|---|
| public ErrorResponseException(HttpStatusCode status, Throwable cause) Constructor with an | |
| ErrorResponseException | back to summary |
|---|---|
| public ErrorResponseException(HttpStatusCode status, ProblemDetail body, Throwable cause) Constructor with a given | |
| ErrorResponseException | back to summary |
|---|---|
| public ErrorResponseException(HttpStatusCode status, ProblemDetail body, Throwable cause, String messageDetailCode, Object[] messageDetailArguments) Constructor with a given
| |
| getBody | back to summary |
|---|---|
| public final ProblemDetail getBody() Implements org. Return the body for the response. To customize the body content, use: By default, the status field of
| |
| getDetailMessageArguments | back to summary |
|---|---|
| public Object[] getDetailMessageArguments() Overrides default org. Doc from org. Return arguments to use along with a
| |
| getDetailMessageCode | back to summary |
|---|---|
| public String getDetailMessageCode() Overrides default org. Doc from org. Return a code to use to resolve the problem "detail" for this exception
through a By default this is initialized via
| |
| getHeaders | back to summary |
|---|---|
| public HttpHeaders getHeaders() Overrides default org. Doc from org. Return headers to use for the response.
| |
| getMessage | back to summary |
|---|---|
| public String getMessage() Overrides java. Doc from java. Returns the detail message string of this throwable. | |
| getStatusCode | back to summary |
|---|---|
| public HttpStatusCode getStatusCode() Implements org. Doc from org. Return the HTTP status code to use for the response.
| |
| initMessageDetailCode | back to summary |
|---|---|
| private String initMessageDetailCode(String messageDetailCode) | |
| setDetail | back to summary |
|---|---|
| public void setDetail(String detail) Set the
| |
| setInstance | back to summary |
|---|---|
| public void setInstance(URI instance) Set the
| |
| setTitle | back to summary |
|---|---|
| public void setTitle(String title) Set the
| |
| setType | back to summary |
|---|---|
| public void setType(URI type) Set the
| |