ErrorResponseException that accepts a "reason", and by
default maps that to the "detail"
of the ProblemDetail.
| Access | Constructor and Description |
|---|---|
| public | ResponseStatusException(HttpStatusCode
the HTTP status (required) status)Constructor with a response status. |
| public | ResponseStatusException(HttpStatusCode
the HTTP status (required) status, String the associated reason (optional) reason)Constructor with a response status and a reason to add to the exception message as explanation. |
| public | ResponseStatusException(int
the HTTP status code value rawStatusCode, String the associated reason (optional) reason, Throwable a nested exception (optional) cause)Constructor with a response status and a reason to add to the exception message as explanation, as well as a nested exception. |
| public | ResponseStatusException(HttpStatusCode
the HTTP status (required) status, String the associated reason (optional) reason, Throwable a nested exception (optional) cause)Constructor with a response status and a reason to add to the exception message as explanation, as well as a nested exception. |
| protected | ResponseStatusException(HttpStatusCode
the HTTP status (required) status, String the associated reason (optional) reason, Throwable a nested exception (optional) cause, String messageDetailCode, Object[] messageDetailArguments)Constructor with a message code and arguments for resolving the error
"detail" via |
| Modifier and Type | Method and Description |
|---|---|
| public HttpHeaders | getHeaders()
Overrides org. Overrides default org. Return headers to add to the error response, e.g. "Allow", "Accept", etc. By default, delegates to |
| public String | getMessage()
Overrides org. Returns the detail message string of this throwable. |
| public String | |
| public HttpHeaders | getResponseHeaders()
Deprecated
since 6.0. as of 6.0 in favor of
getHeaders()
Return headers associated with the exception that should be added to the error response, e.g. "Allow", "Accept", etc. The default implementation in this class returns empty headers. |
| public ProblemDetail | updateAndGetBody(MessageSource
the messageSource, Locale MessageSource to use for the lookupthe locale)Locale to use for the lookupOverrides default org. Use the given |
| reason | back to summary |
|---|---|
| private final String reason
| |
| ResponseStatusException | back to summary |
|---|---|
| public ResponseStatusException(HttpStatusCode status) Constructor with a response status.
| |
| ResponseStatusException | back to summary |
|---|---|
| public ResponseStatusException(HttpStatusCode status, String reason) Constructor with a response status and a reason to add to the exception message as explanation.
| |
| ResponseStatusException | back to summary |
|---|---|
| public ResponseStatusException(int rawStatusCode, String reason, Throwable cause) Constructor with a response status and a reason to add to the exception message as explanation, as well as a nested exception. | |
| ResponseStatusException | back to summary |
|---|---|
| public ResponseStatusException(HttpStatusCode status, String reason, Throwable cause) Constructor with a response status and a reason to add to the exception message as explanation, as well as a nested exception.
| |
| ResponseStatusException | back to summary |
|---|---|
| protected ResponseStatusException(HttpStatusCode status, String reason, Throwable cause, String messageDetailCode, Object[] messageDetailArguments) Constructor with a message code and arguments for resolving the error
"detail" via
| |
| getHeaders | back to summary |
|---|---|
| public HttpHeaders getHeaders() Overrides org. Overrides default org. Return headers to add to the error response, e.g. "Allow", "Accept", etc. By default, delegates to
| |
| getMessage | back to summary |
|---|---|
| public String getMessage() Overrides org. Doc from java. Returns the detail message string of this throwable. | |
| getReason | back to summary |
|---|---|
| public String getReason() The reason explaining the exception (potentially
| |
| getResponseHeaders | back to summary |
|---|---|
| public HttpHeaders getResponseHeaders()
Return headers associated with the exception that should be added to the error response, e.g. "Allow", "Accept", etc. The default implementation in this class returns empty headers.
| |
| updateAndGetBody | back to summary |
|---|---|
| public ProblemDetail updateAndGetBody(MessageSource messageSource, Locale locale) Overrides default org. Doc from org. Use the given
| |