Commit 5c88a6f0 authored by liaozan's avatar liaozan 🏀

Removed duplicated MethodArgumentNotValidException handing

MethodArgumentNotValidException is extend BindException now
parent a572c68b
......@@ -178,13 +178,6 @@ public class DefaultGlobalExceptionHandler implements GlobalExceptionHandler {
return buildResponse(ex, PARAM_INVALID, errorMsg);
}
@ExceptionHandler(MethodArgumentNotValidException.class)
public ResponseDTO<String> handleMethodArgumentNotValidException(MethodArgumentNotValidException ex) {
String errorMsg = buildBindingErrorMsg(ex.getBindingResult());
log.error(errorMsg);
return buildResponse(ex, PARAM_INVALID, errorMsg);
}
@ExceptionHandler(ConstraintViolationException.class)
public ResponseDTO<String> handleConstraintViolationException(ConstraintViolationException ex) {
String errorMsg = buildBindingErrorMsg(ex.getConstraintViolations());
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment