Class GlobalExceptionHandler

java.lang.Object
com.github.damianwajser.exceptions.handlers.GlobalExceptionHandler

@ControllerAdvice
public class GlobalExceptionHandler
extends Object
  • Constructor Summary

    Constructors 
    Constructor Description
    GlobalExceptionHandler()  
  • Method Summary

    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)  
    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)  

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

  • Method Details

    • 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)
    • 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)
    • 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)