fix 修复 特性情况下自定义验证异常处理器报null问题
This commit is contained in:
parent
c563afed59
commit
57e142e160
@ -176,7 +176,7 @@ public class GlobalExceptionHandler {
|
|||||||
@ExceptionHandler(MethodArgumentNotValidException.class)
|
@ExceptionHandler(MethodArgumentNotValidException.class)
|
||||||
public R<Void> handleMethodArgumentNotValidException(MethodArgumentNotValidException e) {
|
public R<Void> handleMethodArgumentNotValidException(MethodArgumentNotValidException e) {
|
||||||
log.error(e.getMessage());
|
log.error(e.getMessage());
|
||||||
String message = e.getBindingResult().getFieldError().getDefaultMessage();
|
String message = StreamUtils.join(e.getBindingResult().getAllErrors(), DefaultMessageSourceResolvable::getDefaultMessage, ", ");
|
||||||
return R.fail(message);
|
return R.fail(message);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user