@ResponseBody public abstract class BusinessExceptionHandler extends Object
| 构造器和说明 |
|---|
BusinessExceptionHandler() |
| 限定符和类型 | 方法和说明 |
|---|---|
Object |
argumentTypeMismatch(Exception e)
参数类型不匹配异常
|
Object |
business(BusinessException e)
拦截业务异常,异常在控制范围内
|
Object |
httpMessageNotReadable(org.springframework.http.converter.HttpMessageNotReadableException e)
http请求 缺少必要的请求正文
|
Object |
unifiedReturn(net.lulihu.exception.ExceptionEnum exceptionEnum) |
Object |
unifiedReturn(net.lulihu.exception.ExceptionEnum exceptionEnum,
Object data) |
Object |
unknown(RuntimeException e)
拦截未知的运行时异常
|
@ExceptionHandler(value=BusinessException.class) public Object business(BusinessException e)
@ExceptionHandler(value=java.lang.RuntimeException.class) public Object unknown(RuntimeException e)
@ExceptionHandler(value={org.springframework.web.method.annotation.MethodArgumentTypeMismatchException.class,net.lulihu.exception.ParamResolveException.class,javax.validation.ConstraintViolationException.class})
public Object argumentTypeMismatch(Exception e)
@ExceptionHandler(value=org.springframework.http.converter.HttpMessageNotReadableException.class) public Object httpMessageNotReadable(org.springframework.http.converter.HttpMessageNotReadableException e)
public Object unifiedReturn(net.lulihu.exception.ExceptionEnum exceptionEnum)
Copyright © 2019. All rights reserved.