@ControllerAdvice public class FrameExceptionHandler extends Object
| 构造器和说明 |
|---|
FrameExceptionHandler() |
| 限定符和类型 | 方法和说明 |
|---|---|
Result<?> |
handleBusinessLogException(BusinessErrorException e)
业务异常处理,并记录error级别日志
|
Result<?> |
handleDuplicateKeyException(org.yaml.snakeyaml.constructor.DuplicateKeyException e)
主键冲突
|
Result<?> |
handleException(Exception e)
一般异常
|
Result<?> |
handleNoFoundException(org.springframework.web.servlet.NoHandlerFoundException e)
请求地址不正确404
|
Result<?> |
httpRequestMethodNotSupportedException(org.springframework.web.HttpRequestMethodNotSupportedException e)
请求方法不支持
|
Result<?> |
methodArgumentNotValidException(org.springframework.web.bind.MethodArgumentNotValidException e)
数据实体校验
|
@ExceptionHandler(value=xyz.shodown.common.exception.BusinessErrorException.class) @ResponseBody public Result<?> handleBusinessLogException(BusinessErrorException e)
e - 业务异常@ExceptionHandler(value=org.springframework.web.servlet.NoHandlerFoundException.class) @ResponseBody public Result<?> handleNoFoundException(org.springframework.web.servlet.NoHandlerFoundException e)
e - NoHandlerFoundException@ExceptionHandler(value=org.yaml.snakeyaml.constructor.DuplicateKeyException.class) @ResponseBody public Result<?> handleDuplicateKeyException(org.yaml.snakeyaml.constructor.DuplicateKeyException e)
e - DuplicateKeyException@ExceptionHandler(value=java.lang.Exception.class) @ResponseBody public Result<?> handleException(Exception e)
e - Exception@ExceptionHandler(value=org.springframework.web.HttpRequestMethodNotSupportedException.class) @ResponseBody public Result<?> httpRequestMethodNotSupportedException(org.springframework.web.HttpRequestMethodNotSupportedException e)
e - HttpRequestMethodNotSupportedException@ExceptionHandler(value=org.springframework.web.bind.MethodArgumentNotValidException.class) @ResponseBody public Result<?> methodArgumentNotValidException(org.springframework.web.bind.MethodArgumentNotValidException e)
e - MethodArgumentNotValidExceptionCopyright © 2022. All rights reserved.