@RestControllerAdvice public class ExceptionHandlerAdvice extends Object
| 构造器和说明 |
|---|
ExceptionHandlerAdvice() |
| 限定符和类型 | 方法和说明 |
|---|---|
ResponseBean |
exception(Exception exception)
业务异常
|
ResponseBean |
handleBusinessException(BusinessException businessException)
业务异常
|
@NotEmpty ResponseBean |
methodArgumentNotValidException(org.springframework.web.bind.MethodArgumentNotValidException ex)
参数校验异常
|
@ExceptionHandler(value=BusinessException.class) public ResponseBean handleBusinessException(BusinessException businessException)
businessException - @NotEmpty @ExceptionHandler(value=org.springframework.web.bind.MethodArgumentNotValidException.class) public @NotEmpty ResponseBean methodArgumentNotValidException(org.springframework.web.bind.MethodArgumentNotValidException ex)
ex - @ExceptionHandler(value=java.lang.Exception.class) public ResponseBean exception(Exception exception)
exception - Copyright © 2022 Anji-Plus. All rights reserved.