修改 DefaultExceptionHandler,防止其拦截其它异常。
parent
2a8a185288
commit
eb6d4fbbea
|
@ -55,7 +55,11 @@ public class DefaultExceptionHandler extends BaseExceptionHandler {
|
||||||
HttpStatus.BAD_REQUEST);
|
HttpStatus.BAD_REQUEST);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ExceptionHandler(Exception.class)
|
@ExceptionHandler({
|
||||||
|
IllegalArgumentException.class,
|
||||||
|
DataAccessException.class,
|
||||||
|
MethodArgumentNotValidException.class
|
||||||
|
})
|
||||||
public ResponseEntity<RestfulResult> handleException(Exception e) {
|
public ResponseEntity<RestfulResult> handleException(Exception e) {
|
||||||
log.error(e.getMessage(), e);
|
log.error(e.getMessage(), e);
|
||||||
return buildExceptionResponse(e);
|
return buildExceptionResponse(e);
|
||||||
|
|
Loading…
Reference in New Issue