Class RestServiceExceptionHandler

java.lang.Object
com.amos2020.javabackend.RestServiceExceptionHandler

@Component
@RestControllerAdvice
public class RestServiceExceptionHandler
extends java.lang.Object
  • Constructor Summary

    Constructors 
    Constructor Description
    RestServiceExceptionHandler()  
  • Method Summary

    Modifier and Type Method Description
    protected org.springframework.web.servlet.ModelAndView handleConstraintViolationException​(javax.validation.ConstraintViolationException ex, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, java.lang.Object handler)  
    protected org.springframework.web.servlet.ModelAndView handleValidationException​(javax.validation.ValidationException ex, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, java.lang.Object handler)  

    Methods inherited from class java.lang.Object

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

  • Method Details

    • handleValidationException

      @ExceptionHandler(javax.validation.ValidationException.class) protected org.springframework.web.servlet.ModelAndView handleValidationException​(javax.validation.ValidationException ex, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, @Nullable java.lang.Object handler) throws java.io.IOException
      Throws:
      java.io.IOException
    • handleConstraintViolationException

      @ExceptionHandler(javax.validation.ConstraintViolationException.class) protected org.springframework.web.servlet.ModelAndView handleConstraintViolationException​(javax.validation.ConstraintViolationException ex, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, @Nullable java.lang.Object handler) throws java.io.IOException
      Throws:
      java.io.IOException