@RestControllerAdvice @Component public class Error extends Object implements org.springframework.boot.web.servlet.error.ErrorController
| 构造器和说明 |
|---|
Error() |
| 限定符和类型 | 方法和说明 |
|---|---|
Resp |
appExceptionHandler(javax.servlet.http.HttpServletRequest req,
AppException e)
自定义异常拦截 (AppException)
|
Resp |
defaultErrorHandler(javax.servlet.http.HttpServletRequest req,
Exception e,
javax.servlet.http.HttpServletResponse response)
拦截控制器请求错误信息
|
@ExceptionHandler(value=java.lang.Exception.class) public Resp defaultErrorHandler(javax.servlet.http.HttpServletRequest req, Exception e, javax.servlet.http.HttpServletResponse response) throws Exception
req - reqe - exceptionException@ExceptionHandler(value=AppException.class) public Resp appExceptionHandler(javax.servlet.http.HttpServletRequest req, AppException e)
req - e - Copyright © 2022. All rights reserved.