Class ValidationAwareRestExceptionHandlers
java.lang.Object
org.springframework.web.servlet.mvc.method.annotation.ResponseEntityExceptionHandler
org.craftercms.commons.rest.BaseRestExceptionHandlers
org.craftercms.commons.validation.rest.ValidationAwareRestExceptionHandlers
- All Implemented Interfaces:
org.springframework.beans.factory.Aware,org.springframework.context.MessageSourceAware
@ControllerAdvice
public class ValidationAwareRestExceptionHandlers
extends BaseRestExceptionHandlers
-
Field Summary
FieldsFields inherited from class org.springframework.web.servlet.mvc.method.annotation.ResponseEntityExceptionHandler
PAGE_NOT_FOUND_LOG_CATEGORY, pageNotFoundLogger -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.http.ResponseEntity<Object> handleGeneralException(Exception ex, org.springframework.web.context.request.WebRequest webRequest) protected org.springframework.http.ResponseEntity<Object> handleHttpMessageNotReadable(org.springframework.http.converter.HttpMessageNotReadableException ex, org.springframework.http.HttpHeaders headers, org.springframework.http.HttpStatusCode status, org.springframework.web.context.request.WebRequest request) protected org.springframework.http.ResponseEntity<Object> handleMethodArgumentNotValid(org.springframework.web.bind.MethodArgumentNotValidException ex, org.springframework.http.HttpHeaders headers, org.springframework.http.HttpStatusCode status, org.springframework.web.context.request.WebRequest request) org.springframework.http.ResponseEntity<Object> handleValidationException(ValidationException ex, org.springframework.web.context.request.WebRequest request) voidsetErrorMessageBundle(ResourceBundle errorMessageBundle) Methods inherited from class org.craftercms.commons.rest.BaseRestExceptionHandlers
handleExceptionInternal, handleExceptionInternalMethods inherited from class org.springframework.web.servlet.mvc.method.annotation.ResponseEntityExceptionHandler
createProblemDetail, createResponseEntity, getMessageSource, handleAsyncRequestNotUsableException, handleAsyncRequestTimeoutException, handleConversionNotSupported, handleErrorResponseException, handleException, handleHandlerMethodValidationException, handleHttpMediaTypeNotAcceptable, handleHttpMediaTypeNotSupported, handleHttpMessageNotWritable, handleHttpRequestMethodNotSupported, handleMaxUploadSizeExceededException, handleMethodValidationException, handleMissingPathVariable, handleMissingServletRequestParameter, handleMissingServletRequestPart, handleNoHandlerFoundException, handleNoResourceFoundException, handleServletRequestBindingException, handleTypeMismatch, setMessageSource
-
Field Details
-
errorMessageBundle
-
-
Constructor Details
-
ValidationAwareRestExceptionHandlers
public ValidationAwareRestExceptionHandlers()
-
-
Method Details
-
setErrorMessageBundle
-
handleValidationException
@ExceptionHandler(ValidationException.class) public org.springframework.http.ResponseEntity<Object> handleValidationException(ValidationException ex, org.springframework.web.context.request.WebRequest request) -
handleHttpMessageNotReadable
protected org.springframework.http.ResponseEntity<Object> handleHttpMessageNotReadable(org.springframework.http.converter.HttpMessageNotReadableException ex, org.springframework.http.HttpHeaders headers, org.springframework.http.HttpStatusCode status, org.springframework.web.context.request.WebRequest request) - Overrides:
handleHttpMessageNotReadablein classorg.springframework.web.servlet.mvc.method.annotation.ResponseEntityExceptionHandler
-
handleMethodArgumentNotValid
protected org.springframework.http.ResponseEntity<Object> handleMethodArgumentNotValid(org.springframework.web.bind.MethodArgumentNotValidException ex, org.springframework.http.HttpHeaders headers, org.springframework.http.HttpStatusCode status, org.springframework.web.context.request.WebRequest request) - Overrides:
handleMethodArgumentNotValidin classorg.springframework.web.servlet.mvc.method.annotation.ResponseEntityExceptionHandler
-
handleGeneralException
@ExceptionHandler(java.lang.Exception.class) public org.springframework.http.ResponseEntity<Object> handleGeneralException(Exception ex, org.springframework.web.context.request.WebRequest webRequest) - Overrides:
handleGeneralExceptionin classBaseRestExceptionHandlers
-