@ControllerAdvice @Order(value=-1) public class GlobalExceptionHandler extends Object
Constructor and Description |
---|
GlobalExceptionHandler() |
Modifier and Type | Method and Description |
---|---|
String |
accountLocked(org.apache.shiro.authc.DisabledAccountException e,
org.springframework.ui.Model model)
账号被冻结异常
|
ErrorResponseData |
bussiness(ServiceException e)
拦截业务异常
|
String |
credentials(org.apache.shiro.authc.CredentialsException e,
org.springframework.ui.Model model)
账号密码错误异常
|
String |
credentials(InvalidKaptchaException e,
org.springframework.ui.Model model)
验证码错误异常
|
ErrorResponseData |
credentials(UndeclaredThrowableException e)
无权访问该资源异常
|
ErrorResponseData |
notFount(RuntimeException e)
拦截未知的运行时异常
|
String |
unAuth(org.apache.shiro.authc.AuthenticationException e)
用户未登录异常
|
@ExceptionHandler(value=ServiceException.class) @ResponseStatus(value=INTERNAL_SERVER_ERROR) @ResponseBody public ErrorResponseData bussiness(ServiceException e)
@ExceptionHandler(value=org.apache.shiro.authc.AuthenticationException.class) @ResponseStatus(value=UNAUTHORIZED) public String unAuth(org.apache.shiro.authc.AuthenticationException e)
@ExceptionHandler(value=org.apache.shiro.authc.DisabledAccountException.class) @ResponseStatus(value=UNAUTHORIZED) public String accountLocked(org.apache.shiro.authc.DisabledAccountException e, org.springframework.ui.Model model)
@ExceptionHandler(value=org.apache.shiro.authc.CredentialsException.class) @ResponseStatus(value=UNAUTHORIZED) public String credentials(org.apache.shiro.authc.CredentialsException e, org.springframework.ui.Model model)
@ExceptionHandler(value=InvalidKaptchaException.class) @ResponseStatus(value=BAD_REQUEST) public String credentials(InvalidKaptchaException e, org.springframework.ui.Model model)
@ExceptionHandler(value=java.lang.reflect.UndeclaredThrowableException.class) @ResponseStatus(value=UNAUTHORIZED) @ResponseBody public ErrorResponseData credentials(UndeclaredThrowableException e)
@ExceptionHandler(value=java.lang.RuntimeException.class) @ResponseStatus(value=INTERNAL_SERVER_ERROR) @ResponseBody public ErrorResponseData notFount(RuntimeException e)
Copyright © 2018. All rights reserved.