@RestControllerAdvice public class GlobalExceptionHandler extends Object
| 构造器和说明 |
|---|
GlobalExceptionHandler() |
| 限定符和类型 | 方法和说明 |
|---|---|
com.founder.common.core.web.domain.AjaxResult |
handleBindException(org.springframework.validation.BindException e)
自定义验证异常
|
com.founder.common.core.web.domain.AjaxResult |
handleDemoModeException(com.founder.common.core.exception.DemoModeException e)
演示模式异常
|
com.founder.common.core.web.domain.AjaxResult |
handleException(Exception e,
javax.servlet.http.HttpServletRequest request)
系统异常
|
com.founder.common.core.web.domain.AjaxResult |
handleHttpRequestMethodNotSupported(org.springframework.web.HttpRequestMethodNotSupportedException e,
javax.servlet.http.HttpServletRequest request)
请求方式不支持
|
com.founder.common.core.web.domain.AjaxResult |
handleInnerAuthException(com.founder.common.core.exception.InnerAuthException e)
内部认证异常
|
Object |
handleMethodArgumentNotValidException(org.springframework.web.bind.MethodArgumentNotValidException e)
自定义验证异常
|
com.founder.common.core.web.domain.AjaxResult |
handlePreAuthorizeException(com.founder.common.core.exception.PreAuthorizeException e,
javax.servlet.http.HttpServletRequest request)
权限异常
|
com.founder.common.core.web.domain.AjaxResult |
handleRuntimeException(RuntimeException e,
javax.servlet.http.HttpServletRequest request)
拦截未知的运行时异常
|
com.founder.common.core.web.domain.AjaxResult |
handleServiceException(com.founder.common.core.exception.ServiceException e,
javax.servlet.http.HttpServletRequest request)
业务异常
|
@ExceptionHandler(value=com.founder.common.core.exception.PreAuthorizeException.class)
public com.founder.common.core.web.domain.AjaxResult handlePreAuthorizeException(com.founder.common.core.exception.PreAuthorizeException e,
javax.servlet.http.HttpServletRequest request)
@ExceptionHandler(value=org.springframework.web.HttpRequestMethodNotSupportedException.class)
public com.founder.common.core.web.domain.AjaxResult handleHttpRequestMethodNotSupported(org.springframework.web.HttpRequestMethodNotSupportedException e,
javax.servlet.http.HttpServletRequest request)
@ExceptionHandler(value=com.founder.common.core.exception.ServiceException.class)
public com.founder.common.core.web.domain.AjaxResult handleServiceException(com.founder.common.core.exception.ServiceException e,
javax.servlet.http.HttpServletRequest request)
@ExceptionHandler(value=java.lang.RuntimeException.class) public com.founder.common.core.web.domain.AjaxResult handleRuntimeException(RuntimeException e, javax.servlet.http.HttpServletRequest request)
@ExceptionHandler(value=java.lang.Exception.class) public com.founder.common.core.web.domain.AjaxResult handleException(Exception e, javax.servlet.http.HttpServletRequest request)
@ExceptionHandler(value=org.springframework.validation.BindException.class) public com.founder.common.core.web.domain.AjaxResult handleBindException(org.springframework.validation.BindException e)
@ExceptionHandler(value=org.springframework.web.bind.MethodArgumentNotValidException.class) public Object handleMethodArgumentNotValidException(org.springframework.web.bind.MethodArgumentNotValidException e)
@ExceptionHandler(value=com.founder.common.core.exception.InnerAuthException.class) public com.founder.common.core.web.domain.AjaxResult handleInnerAuthException(com.founder.common.core.exception.InnerAuthException e)
@ExceptionHandler(value=com.founder.common.core.exception.DemoModeException.class) public com.founder.common.core.web.domain.AjaxResult handleDemoModeException(com.founder.common.core.exception.DemoModeException e)
Copyright © 2021. All rights reserved.