RED-5293: Changed error message for empty parameters to show client which parameter is broken

This commit is contained in:
Ali Oezyetimoglu 2022-11-07 15:04:30 +01:00
parent 5924d12059
commit 034fdd0f65

View File

@ -100,7 +100,7 @@ public class ControllerAdvice {
@ExceptionHandler(value = MethodArgumentNotValidException.class)
public ErrorMessage handleMethodArgumentNotValidException(MethodArgumentNotValidException e) {
return new ErrorMessage(OffsetDateTime.now(), String.format("You have empty/wrong formatted parameters: %s", e.getParameter()));
return new ErrorMessage(OffsetDateTime.now(), String.format("You have empty/wrong formatted parameters: %s", e.getParameter().getParameterName()));
}
}