类 GlobalExceptionHandler

java.lang.Object
club.zhcs.lina.starter.exception.GlobalExceptionHandler

@RestController @ControllerAdvice public class GlobalExceptionHandler extends Object
作者:
Kerbores(kerbores@riemann.tech)
  • 构造器详细资料

    • GlobalExceptionHandler

      public GlobalExceptionHandler()
  • 方法详细资料

    • defaultErrorHandler

      @ExceptionHandler(java.lang.Exception.class) @ResponseStatus(INTERNAL_SERVER_ERROR) public GlobalError defaultErrorHandler(javax.servlet.http.HttpServletRequest request, Exception e)
    • bizExceptionHandler

      @ExceptionHandler(BizException.class) @ResponseStatus(INTERNAL_SERVER_ERROR) public GlobalError bizExceptionHandler(javax.servlet.http.HttpServletResponse response, Exception e)
    • handle

      @ExceptionHandler(javax.validation.ValidationException.class) @ResponseStatus(BAD_REQUEST) public GlobalError handle(javax.validation.ValidationException e)
    • validate

      @ExceptionHandler(org.springframework.web.bind.MethodArgumentNotValidException.class) @ResponseStatus(BAD_REQUEST) public GlobalError validate(javax.servlet.http.HttpServletResponse response, org.springframework.web.bind.MethodArgumentNotValidException e)
    • auth

      @ExceptionHandler(club.zhcs.lina.auth.AuthException.class) @ResponseStatus(FORBIDDEN) public GlobalError auth(javax.servlet.http.HttpServletResponse response, AuthException e)