类 ControllerExceptionAdvice

java.lang.Object
cn.gybyt.web.advice.ControllerExceptionAdvice

@RestControllerAdvice @ConditionalOnMissingBean(annotation=org.springframework.web.bind.annotation.RestControllerAdvice.class) public class ControllerExceptionAdvice extends Object
异常拦截
  • 构造器详细资料

    • ControllerExceptionAdvice

      public ControllerExceptionAdvice()
  • 方法详细资料

    • MethodArgumentNotValidExceptionHandler

      @ExceptionHandler(java.lang.Exception.class) public org.springframework.http.ResponseEntity MethodArgumentNotValidExceptionHandler(Exception e)
      处理web全局异常
      参数:
      e -
      返回:
    • APIExceptionHandler

      @ExceptionHandler(BaseException.class) public org.springframework.http.ResponseEntity APIExceptionHandler(BaseException e)
      处理自定义异常
      参数:
      e -
      返回: