Class RestExceptionHandler


  • @ControllerAdvice
    public class RestExceptionHandler
    extends Object
    • Constructor Detail

      • RestExceptionHandler

        public RestExceptionHandler()
    • Method Detail

      • badRequestHandler

        @ExceptionHandler({java.lang.IllegalArgumentException.class,org.springframework.web.bind.ServletRequestBindingException.class,org.springframework.beans.TypeMismatchException.class,org.springframework.web.bind.MethodArgumentNotValidException.class})
        public org.springframework.http.ResponseEntity<?> badRequestHandler​(Exception ex,
                                                                            javax.servlet.http.HttpServletRequest request)
      • badRequestHandlerShowingMostSpecificCause

        @ExceptionHandler({org.springframework.http.converter.HttpMessageNotReadableException.class,org.springframework.web.bind.MissingServletRequestParameterException.class})
        public org.springframework.http.ResponseEntity<?> badRequestHandlerShowingMostSpecificCause​(Exception ex,
                                                                                                    javax.servlet.http.HttpServletRequest request)
      • methodNotAllowedHandler

        @ExceptionHandler(org.springframework.web.HttpRequestMethodNotSupportedException.class)
        public org.springframework.http.ResponseEntity<?> methodNotAllowedHandler​(Exception ex,
                                                                                  javax.servlet.http.HttpServletRequest request)
      • notAcceptableHandler

        @ExceptionHandler(org.springframework.web.HttpMediaTypeNotAcceptableException.class)
        public org.springframework.http.ResponseEntity<?> notAcceptableHandler​(Exception ex,
                                                                               javax.servlet.http.HttpServletRequest request)
      • unsupportedMediaTypeHandler

        @ExceptionHandler(org.springframework.web.HttpMediaTypeNotSupportedException.class)
        public org.springframework.http.ResponseEntity<?> unsupportedMediaTypeHandler​(Exception ex,
                                                                                      javax.servlet.http.HttpServletRequest request)
      • serviceUnavailableHandler

        @ExceptionHandler(org.springframework.web.context.request.async.AsyncRequestTimeoutException.class)
        public org.springframework.http.ResponseEntity<?> serviceUnavailableHandler​(Exception ex,
                                                                                    javax.servlet.http.HttpServletRequest request)
      • handleResponseStatusException

        @ExceptionHandler(org.springframework.web.server.ResponseStatusException.class)
        public org.springframework.http.ResponseEntity<?> handleResponseStatusException​(org.springframework.web.server.ResponseStatusException ex,
                                                                                        javax.servlet.http.HttpServletRequest request)
      • defaultHandler

        @ExceptionHandler(java.lang.Exception.class)
        public org.springframework.http.ResponseEntity<?> defaultHandler​(Exception ex,
                                                                         javax.servlet.http.HttpServletRequest request,
                                                                         javax.servlet.http.HttpServletResponse response)