类 Error
java.lang.Object
cn.airfei.aircore.core.common.Error
- 所有已实现的接口:
org.springframework.boot.web.servlet.error.ErrorController
@RestControllerAdvice
@Component
public class Error
extends Object
implements org.springframework.boot.web.servlet.error.ErrorController
统一抛出异常
- 作者:
- air
-
构造器概要
构造器 -
方法概要
修饰符和类型方法说明appExceptionHandler(javax.servlet.http.HttpServletRequest req, AppException e) 自定义异常拦截 (AppException)defaultErrorHandler(javax.servlet.http.HttpServletRequest req, Exception e, javax.servlet.http.HttpServletResponse response) 拦截控制器请求错误信息
-
构造器详细资料
-
Error
public Error()
-
-
方法详细资料
-
defaultErrorHandler
@ExceptionHandler(java.lang.Exception.class) public Resp defaultErrorHandler(javax.servlet.http.HttpServletRequest req, Exception e, javax.servlet.http.HttpServletResponse response) throws Exception 拦截控制器请求错误信息- 参数:
req- reqe- exception- 返回:
- resp
- 抛出:
Exception
-
appExceptionHandler
@ExceptionHandler(AppException.class) public Resp appExceptionHandler(javax.servlet.http.HttpServletRequest req, AppException e) 自定义异常拦截 (AppException)- 参数:
req-e-- 返回:
-