@RestControllerAdvice
@ConditionalOnProperty(prefix="gc.starter.component",
name="GlobalExceptionHandler",
havingValue="GlobalExceptionHandler",
matchIfMissing=true)
public class GlobalExceptionHandler
extends Object
| 构造器和说明 |
|---|
GlobalExceptionHandler() |
| 限定符和类型 | 方法和说明 |
|---|---|
R<String> |
authorizationException(org.apache.shiro.authz.AuthorizationException e) |
R<String> |
exception(javax.servlet.http.HttpServletRequest request,
GlobalException e)
处理自定义异常
|
R<String> |
expiredJwtException(org.apache.shiro.authz.AuthorizationException e) |
R<String> |
handleException(Exception e) |
R<String> |
httpRequestMethodNotSupportedException(org.springframework.web.HttpRequestMethodNotSupportedException e) |
R<String> |
illegalArgumentException(Exception e) |
void |
init() |
R<String> |
unauthorizedException(org.apache.shiro.authz.AuthorizationException e) |
@PostConstruct public void init()
@ExceptionHandler(value=org.apache.shiro.authz.AuthorizationException.class) public R<String> authorizationException(org.apache.shiro.authz.AuthorizationException e)
@ExceptionHandler(value=org.apache.shiro.authz.UnauthorizedException.class) public R<String> unauthorizedException(org.apache.shiro.authz.AuthorizationException e)
@ExceptionHandler(value=io.jsonwebtoken.ExpiredJwtException.class) public R<String> expiredJwtException(org.apache.shiro.authz.AuthorizationException e)
@ExceptionHandler(value=org.springframework.web.HttpRequestMethodNotSupportedException.class) public R<String> httpRequestMethodNotSupportedException(org.springframework.web.HttpRequestMethodNotSupportedException e)
@ExceptionHandler(value=GlobalException.class) public R<String> exception(javax.servlet.http.HttpServletRequest request, GlobalException e)
@ExceptionHandler(value=java.lang.IllegalArgumentException.class) public R<String> illegalArgumentException(Exception e)
@ExceptionHandler(value=java.lang.Exception.class) public R<String> handleException(Exception e)
Copyright © 2023. All rights reserved.