Class GlobalExceptionHandler


  • @ControllerAdvice
    public class GlobalExceptionHandler
    extends Object
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected org.springframework.http.ResponseEntity<com.github.damianwajser.exceptions.model.ErrorMessage> handleConflict​(com.github.damianwajser.exceptions.RestException ex, javax.servlet.http.HttpServletRequest request, Locale locale)  
      protected org.springframework.http.ResponseEntity<com.github.damianwajser.exceptions.model.ErrorMessage> handleDefault​(Exception ex, javax.servlet.http.HttpServletRequest request, Locale locale)  
      org.springframework.http.ResponseEntity<com.github.damianwajser.exceptions.model.ErrorMessage> handleNestedRuntimeException​(org.springframework.core.NestedRuntimeException ex, javax.servlet.http.HttpServletRequest request)  
      org.springframework.http.ResponseEntity<com.github.damianwajser.exceptions.model.ErrorMessage> handleValidationExceptions​(javax.validation.ConstraintViolationException ex, javax.servlet.http.HttpServletRequest request)  
      org.springframework.http.ResponseEntity<com.github.damianwajser.exceptions.model.ErrorMessage> handleValidationExceptions​(org.springframework.validation.BindException ex, javax.servlet.http.HttpServletRequest request)  
      org.springframework.http.ResponseEntity<com.github.damianwajser.exceptions.model.ErrorMessage> handleValidationExceptions​(org.springframework.web.bind.MethodArgumentNotValidException ex, javax.servlet.http.HttpServletRequest request)  
    • Constructor Detail

      • GlobalExceptionHandler

        public GlobalExceptionHandler()
    • Method Detail

      • handleDefault

        @ExceptionHandler(java.lang.Exception.class)
        protected org.springframework.http.ResponseEntity<com.github.damianwajser.exceptions.model.ErrorMessage> handleDefault​(Exception ex,
                                                                                                                               javax.servlet.http.HttpServletRequest request,
                                                                                                                               Locale locale)
      • handleConflict

        @ExceptionHandler(com.github.damianwajser.exceptions.RestException.class)
        protected org.springframework.http.ResponseEntity<com.github.damianwajser.exceptions.model.ErrorMessage> handleConflict​(com.github.damianwajser.exceptions.RestException ex,
                                                                                                                                javax.servlet.http.HttpServletRequest request,
                                                                                                                                Locale locale)
      • handleValidationExceptions

        @ExceptionHandler(org.springframework.web.bind.MethodArgumentNotValidException.class)
        public org.springframework.http.ResponseEntity<com.github.damianwajser.exceptions.model.ErrorMessage> handleValidationExceptions​(org.springframework.web.bind.MethodArgumentNotValidException ex,
                                                                                                                                         javax.servlet.http.HttpServletRequest request)
      • handleNestedRuntimeException

        @ExceptionHandler(org.springframework.core.NestedRuntimeException.class)
        public org.springframework.http.ResponseEntity<com.github.damianwajser.exceptions.model.ErrorMessage> handleNestedRuntimeException​(org.springframework.core.NestedRuntimeException ex,
                                                                                                                                           javax.servlet.http.HttpServletRequest request)
      • handleValidationExceptions

        @ExceptionHandler(javax.validation.ConstraintViolationException.class)
        public org.springframework.http.ResponseEntity<com.github.damianwajser.exceptions.model.ErrorMessage> handleValidationExceptions​(javax.validation.ConstraintViolationException ex,
                                                                                                                                         javax.servlet.http.HttpServletRequest request)
      • handleValidationExceptions

        @ExceptionHandler(org.springframework.validation.BindException.class)
        public org.springframework.http.ResponseEntity<com.github.damianwajser.exceptions.model.ErrorMessage> handleValidationExceptions​(org.springframework.validation.BindException ex,
                                                                                                                                         javax.servlet.http.HttpServletRequest request)