no message
Showing
1 changed file
with
2 additions
and
1 deletions
| ... | @@ -186,7 +186,8 @@ public class GlobalExceptionHandler { | ... | @@ -186,7 +186,8 @@ public class GlobalExceptionHandler { |
| 186 | @ExceptionHandler(MethodArgumentNotValidException.class) | 186 | @ExceptionHandler(MethodArgumentNotValidException.class) |
| 187 | public R<Void> handleMethodArgumentNotValidException(MethodArgumentNotValidException e) { | 187 | public R<Void> handleMethodArgumentNotValidException(MethodArgumentNotValidException e) { |
| 188 | System.out.println("=============="+e.getMessage()); | 188 | System.out.println("=============="+e.getMessage()); |
| 189 | log.error(e.getMessage()); | 189 | log.error(e.getBindingResult().getObjectName()); |
| 190 | log.error(e.getBindingResult().getFieldError().getField()); | ||
| 190 | String message = e.getBindingResult().getFieldError().getDefaultMessage(); | 191 | String message = e.getBindingResult().getFieldError().getDefaultMessage(); |
| 191 | return R.fail(message); | 192 | return R.fail(message); |
| 192 | } | 193 | } | ... | ... |
-
Please register or sign in to post a comment