Class ValidationAwareRestExceptionHandlers
- java.lang.Object
-
- org.springframework.web.servlet.mvc.method.annotation.ResponseEntityExceptionHandler
-
- org.craftercms.commons.rest.BaseRestExceptionHandlers
-
- org.craftercms.commons.validation.rest.ValidationAwareRestExceptionHandlers
-
@ControllerAdvice public class ValidationAwareRestExceptionHandlers extends BaseRestExceptionHandlers
-
-
Field Summary
Fields Modifier and Type Field Description protected ResourceBundleerrorMessageBundle
-
Constructor Summary
Constructors Constructor Description ValidationAwareRestExceptionHandlers()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.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.HttpStatus status, org.springframework.web.context.request.WebRequest webRequest)protected org.springframework.http.ResponseEntity<Object>handleMethodArgumentNotValid(org.springframework.web.bind.MethodArgumentNotValidException ex, org.springframework.http.HttpHeaders headers, org.springframework.http.HttpStatus 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, handleExceptionInternal
-
Methods inherited from class org.springframework.web.servlet.mvc.method.annotation.ResponseEntityExceptionHandler
handleAsyncRequestTimeoutException, handleBindException, handleConversionNotSupported, handleException, handleHttpMediaTypeNotAcceptable, handleHttpMediaTypeNotSupported, handleHttpMessageNotWritable, handleHttpRequestMethodNotSupported, handleMissingPathVariable, handleMissingServletRequestParameter, handleMissingServletRequestPart, handleNoHandlerFoundException, handleServletRequestBindingException, handleTypeMismatch
-
-
-
-
Field Detail
-
errorMessageBundle
protected ResourceBundle errorMessageBundle
-
-
Method Detail
-
setErrorMessageBundle
public void setErrorMessageBundle(ResourceBundle errorMessageBundle)
-
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.HttpStatus status, org.springframework.web.context.request.WebRequest webRequest)
- 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.HttpStatus 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
-
-