Class ExceptionHandlers


  • @ControllerAdvice
    public class ExceptionHandlers
    extends org.springframework.web.servlet.mvc.method.annotation.ResponseEntityExceptionHandler
    ControllerAdvice for controllers that includes exception handling for all exceptions.
    Author:
    avasquez
    • Constructor Detail

      • ExceptionHandlers

        public ExceptionHandlers()
    • Method Detail

      • handleInvalidTokenManagementException

        @ExceptionHandler(org.craftercms.commons.exceptions.InvalidManagementTokenException.class)
        public org.springframework.http.ResponseEntity<Object> handleInvalidTokenManagementException​(org.craftercms.commons.exceptions.InvalidManagementTokenException e,
                                                                                                     org.springframework.web.context.request.WebRequest request)
      • handleActionDeniedException

        @ExceptionHandler(org.craftercms.commons.security.exception.ActionDeniedException.class)
        public org.springframework.http.ResponseEntity<Object> handleActionDeniedException​(org.craftercms.commons.security.exception.ActionDeniedException e,
                                                                                           org.springframework.web.context.request.WebRequest request)
      • handleNoSuchTicketException

        @ExceptionHandler(Expired.class)
        public org.springframework.http.ResponseEntity<Object> handleNoSuchTicketException​(NoSuchTicketException.Expired e,
                                                                                           org.springframework.web.context.request.WebRequest request)
      • handlePermissionException

        @ExceptionHandler(org.craftercms.commons.security.exception.PermissionException.class)
        public org.springframework.http.ResponseEntity<Object> handlePermissionException​(org.craftercms.commons.security.exception.PermissionException e,
                                                                                         org.springframework.web.context.request.WebRequest request)
      • handleExceptionInternal

        protected org.springframework.http.ResponseEntity<Object> handleExceptionInternal​(Exception ex,
                                                                                          Object body,
                                                                                          org.springframework.http.HttpHeaders headers,
                                                                                          org.springframework.http.HttpStatus status,
                                                                                          org.springframework.web.context.request.WebRequest request)
        Overrides:
        handleExceptionInternal in class org.springframework.web.servlet.mvc.method.annotation.ResponseEntityExceptionHandler
      • handleExceptionInternal

        protected org.springframework.http.ResponseEntity<Object> handleExceptionInternal​(Exception ex,
                                                                                          org.springframework.http.HttpStatus status,
                                                                                          ErrorCode errorCode,
                                                                                          org.springframework.web.context.request.WebRequest request)
      • handleExceptionInternal

        protected org.springframework.http.ResponseEntity<Object> handleExceptionInternal​(Exception ex,
                                                                                          org.springframework.http.HttpHeaders headers,
                                                                                          org.springframework.http.HttpStatus status,
                                                                                          ErrorCode errorCode,
                                                                                          org.springframework.web.context.request.WebRequest request)