Class ExceptionHandlers
java.lang.Object
org.craftercms.core.controller.rest.ExceptionHandlers
@Order
@ControllerAdvice(annotations=org.springframework.web.bind.annotation.RestController.class)
public class ExceptionHandlers
extends Object
Global exception handlers for Crafter REST services.
- Author:
- avasquez
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionhandleAuthenticationException(javax.servlet.http.HttpServletRequest request, AuthenticationException e) handleConstraintValidationException(javax.validation.ConstraintViolationException e) handleException(javax.servlet.http.HttpServletRequest request, Exception e) handleForbiddenPathException(javax.servlet.http.HttpServletRequest request, ForbiddenPathException e) handleInvalidContextException(javax.servlet.http.HttpServletRequest request, org.craftercms.commons.exceptions.InvalidManagementTokenException e) handleInvalidContextException(javax.servlet.http.HttpServletRequest request, InvalidContextException e) handleInvalidContextException(javax.servlet.http.HttpServletRequest request, org.springframework.web.bind.MissingServletRequestParameterException e) handleMethodArgumentTypeMismatchException(org.springframework.web.method.annotation.MethodArgumentTypeMismatchException e) handlePathNotFoundException(javax.servlet.http.HttpServletRequest request, PathNotFoundException e) org.craftercms.commons.validation.ValidationResulthandleValidationException(javax.servlet.http.HttpServletRequest request, org.craftercms.commons.validation.ValidationException e) org.craftercms.commons.validation.ValidationResulthandleValidationRuntimeException(javax.servlet.http.HttpServletRequest request, org.craftercms.commons.validation.ValidationRuntimeException e)
-
Field Details
-
RESULT_KEY_VALIDATION_ERRORS
- See Also:
-
-
Constructor Details
-
ExceptionHandlers
public ExceptionHandlers()
-
-
Method Details
-
handleInvalidContextException
@ExceptionHandler(org.springframework.web.bind.MissingServletRequestParameterException.class) @ResponseStatus(BAD_REQUEST) @ResponseBody public Map<String,Object> handleInvalidContextException(javax.servlet.http.HttpServletRequest request, org.springframework.web.bind.MissingServletRequestParameterException e) -
handleInvalidContextException
@ExceptionHandler(org.craftercms.commons.exceptions.InvalidManagementTokenException.class) @ResponseStatus(UNAUTHORIZED) @ResponseBody public Map<String,Object> handleInvalidContextException(javax.servlet.http.HttpServletRequest request, org.craftercms.commons.exceptions.InvalidManagementTokenException e) -
handleInvalidContextException
@ExceptionHandler(InvalidContextException.class) @ResponseStatus(BAD_REQUEST) @ResponseBody public Map<String,Object> handleInvalidContextException(javax.servlet.http.HttpServletRequest request, InvalidContextException e) -
handleAuthenticationException
@ExceptionHandler(AuthenticationException.class) @ResponseStatus(UNAUTHORIZED) @ResponseBody public Map<String,Object> handleAuthenticationException(javax.servlet.http.HttpServletRequest request, AuthenticationException e) -
handlePathNotFoundException
@ExceptionHandler(PathNotFoundException.class) @ResponseStatus(NOT_FOUND) @ResponseBody public Map<String,Object> handlePathNotFoundException(javax.servlet.http.HttpServletRequest request, PathNotFoundException e) -
handleForbiddenPathException
@ExceptionHandler(ForbiddenPathException.class) @ResponseStatus(FORBIDDEN) @ResponseBody public Map<String,Object> handleForbiddenPathException(javax.servlet.http.HttpServletRequest request, ForbiddenPathException e) -
handleValidationException
@ExceptionHandler(org.craftercms.commons.validation.ValidationException.class) @ResponseStatus(BAD_REQUEST) @ResponseBody public org.craftercms.commons.validation.ValidationResult handleValidationException(javax.servlet.http.HttpServletRequest request, org.craftercms.commons.validation.ValidationException e) -
handleValidationRuntimeException
@ExceptionHandler(org.craftercms.commons.validation.ValidationRuntimeException.class) @ResponseStatus(BAD_REQUEST) @ResponseBody public org.craftercms.commons.validation.ValidationResult handleValidationRuntimeException(javax.servlet.http.HttpServletRequest request, org.craftercms.commons.validation.ValidationRuntimeException e) -
handleConstraintValidationException
-
handleMethodArgumentTypeMismatchException
-
handleException
@ExceptionHandler(java.lang.Exception.class) @ResponseStatus(INTERNAL_SERVER_ERROR) @ResponseBody public Map<String,Object> handleException(javax.servlet.http.HttpServletRequest request, Exception e)
-