diff --git a/plusone-basic/plusone-basic-application/src/main/java/xyz/zhouxy/plusone/exception/handler/DefaultExceptionHandler.java b/plusone-basic/plusone-basic-application/src/main/java/xyz/zhouxy/plusone/exception/handler/DefaultExceptionHandler.java index e991bb8..af53870 100644 --- a/plusone-basic/plusone-basic-application/src/main/java/xyz/zhouxy/plusone/exception/handler/DefaultExceptionHandler.java +++ b/plusone-basic/plusone-basic-application/src/main/java/xyz/zhouxy/plusone/exception/handler/DefaultExceptionHandler.java @@ -55,7 +55,11 @@ public class DefaultExceptionHandler extends BaseExceptionHandler { HttpStatus.BAD_REQUEST); } - @ExceptionHandler(Exception.class) + @ExceptionHandler({ + IllegalArgumentException.class, + DataAccessException.class, + MethodArgumentNotValidException.class + }) public ResponseEntity handleException(Exception e) { log.error(e.getMessage(), e); return buildExceptionResponse(e);