类 ControllerExceptionAdvice
java.lang.Object
cn.gybyt.web.advice.ControllerExceptionAdvice
@RestControllerAdvice
@ConditionalOnMissingBean(annotation=org.springframework.web.bind.annotation.RestControllerAdvice.class)
public class ControllerExceptionAdvice
extends Object
异常拦截
-
构造器概要
构造器 -
方法概要
修饰符和类型方法说明org.springframework.http.ResponseEntity处理自定义异常org.springframework.http.ResponseEntity处理web全局异常
-
构造器详细资料
-
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-- 返回:
-