@ControllerAdvice @ConditionalOnProperty(prefix="yue.exception-handler", name="enabled", havingValue="true", matchIfMissing=true) public class ResultExceptionHandler extends AbstractExceptionHandler
Constructor and Description |
---|
ResultExceptionHandler() |
Modifier and Type | Method and Description |
---|---|
void |
authorizeExceptionHandler(AuthorizeException e)
拦截登录异常(Admin)-301
|
Result<?> |
bindExceptionHandler(org.springframework.validation.BindException e)
Valid 验证异常统一处理-433
|
Result<?> |
httpRequestMethodNotSupportedExceptionHandler(org.springframework.web.HttpRequestMethodNotSupportedException e)
方法不允许(Method Not Allowed)-405
|
Result<?> |
paramDecryptExceptionHandler(ParamDecryptException e)
解密异常统一处理-435
|
Result<?> |
paramExceptionHandler(ParamException e)
参数效验未通过统一处理-433
|
Result<?> |
paramVoidExceptionHandler()
参数效验为空统一处理-432
|
Result<?> |
resultExceptionHandler(ResultException e)
异常结果处理-synchronized
|
Result<?> |
validateExceptionHandler(cn.hutool.core.exceptions.ValidateException e)
验证异常统一处理-433
|
apiVersionDeprecatedExceptionHandler, attackExceptionHandler, clientFallbackExceptionHandler, convertExceptionHandler, dbExceptionHandler, exceptionHandler, forbiddenExceptionHandler, loginExceptionHandler
@ResponseBody @ExceptionHandler(value=ResultException.class) public Result<?> resultExceptionHandler(ResultException e)
resultExceptionHandler
in class AbstractExceptionHandler
e
- 结果异常@ResponseBody @ResponseStatus(code=METHOD_NOT_ALLOWED) @ExceptionHandler(value=org.springframework.web.HttpRequestMethodNotSupportedException.class) public Result<?> httpRequestMethodNotSupportedExceptionHandler(org.springframework.web.HttpRequestMethodNotSupportedException e)
客户端使用服务端不支持的 Http Request Method 进行接口调用
e
- 方法不允许异常@ResponseBody @ExceptionHandler(value=ParamVoidException.class) public Result<?> paramVoidExceptionHandler()
paramVoidExceptionHandler
in class AbstractExceptionHandler
@ResponseBody @ExceptionHandler(value=ParamException.class) public Result<?> paramExceptionHandler(ParamException e)
paramExceptionHandler
in class AbstractExceptionHandler
e
- 参数校验未通过异常@ResponseBody @ExceptionHandler(value=org.springframework.validation.BindException.class) public Result<?> bindExceptionHandler(org.springframework.validation.BindException e)
bindExceptionHandler
in class AbstractExceptionHandler
e
- 验证异常@ResponseBody @ExceptionHandler(value=cn.hutool.core.exceptions.ValidateException.class) public Result<?> validateExceptionHandler(cn.hutool.core.exceptions.ValidateException e)
validateExceptionHandler
in class AbstractExceptionHandler
e
- 验证异常@ResponseBody @ExceptionHandler(value=ParamDecryptException.class) public Result<?> paramDecryptExceptionHandler(ParamDecryptException e)
paramDecryptExceptionHandler
in class AbstractExceptionHandler
e
- 解密异常@ExceptionHandler(value=AuthorizeException.class) public void authorizeExceptionHandler(AuthorizeException e) throws IOException
authorizeExceptionHandler
in class AbstractExceptionHandler
e
- 认证异常IOException
- 重定向失败Copyright © 2022 Pivotal Software, Inc.. All rights reserved.