@ControllerAdvice public class HawaiiResponseEntityExceptionHandler extends ResponseEntityExceptionHandler
PAGE_NOT_FOUND_LOG_CATEGORY, pageNotFoundLogger
Constructor and Description |
---|
HawaiiResponseEntityExceptionHandler(ValidationErrorResourceAssembler validationErrorResourceAssembler) |
Modifier and Type | Method and Description |
---|---|
protected ErrorResponseResource |
buildErrorResponseBody(Throwable t,
HttpStatus status,
WebRequest request)
Builds a meaningful response body for the given throwable, HTTP status and request.
|
protected ResponseEntity<Object> |
handleExceptionInternal(Exception ex,
Object body,
HttpHeaders headers,
HttpStatus status,
WebRequest request) |
ResponseEntity |
handleHttpException(HttpException e,
WebRequest request)
Handles
HttpException instances. |
ResponseEntity |
handleThrowable(Throwable t,
WebRequest request)
Handles
Throwable instances. |
ResponseEntity |
handleValidationException(ValidationException e,
WebRequest request)
Handles
ValidationException instances. |
handleAsyncRequestTimeoutException, handleBindException, handleConversionNotSupported, handleException, handleHttpMediaTypeNotAcceptable, handleHttpMediaTypeNotSupported, handleHttpMessageNotReadable, handleHttpMessageNotWritable, handleHttpRequestMethodNotSupported, handleMethodArgumentNotValid, handleMissingPathVariable, handleMissingServletRequestParameter, handleMissingServletRequestPart, handleNoHandlerFoundException, handleNoSuchRequestHandlingMethod, handleServletRequestBindingException, handleTypeMismatch
public HawaiiResponseEntityExceptionHandler(ValidationErrorResourceAssembler validationErrorResourceAssembler)
@ExceptionHandler(value=HttpException.class) @ResponseBody public ResponseEntity handleHttpException(HttpException e, WebRequest request)
HttpException
instances.
Each HttpException
has an associated HttpStatus
that is used as the response
status.
e
- the exceptionrequest
- the current request@ExceptionHandler(value=ValidationException.class) @ResponseBody public ResponseEntity handleValidationException(ValidationException e, WebRequest request)
ValidationException
instances.
The response status is: 400 Bad Request.
e
- the exceptionrequest
- the current request@ExceptionHandler(value=java.lang.Throwable.class) @ResponseBody public ResponseEntity handleThrowable(Throwable t, WebRequest request)
Throwable
instances. This method acts as a fallback handler.t
- the exceptionrequest
- the current requestprotected ResponseEntity<Object> handleExceptionInternal(Exception ex, Object body, HttpHeaders headers, HttpStatus status, WebRequest request)
handleExceptionInternal
in class ResponseEntityExceptionHandler
protected ErrorResponseResource buildErrorResponseBody(Throwable t, HttpStatus status, WebRequest request)
t
- the exceptionstatus
- the HTTP statusrequest
- the current request