RED-5293: Changed output to client to explain which argument is broken

This commit is contained in:
Ali Oezyetimoglu 2022-11-07 16:23:53 +01:00
parent 926d324a90
commit 9b7d1536eb

View File

@ -103,7 +103,7 @@ public class ControllerAdvice {
public ErrorMessage handleMethodArgumentNotValidException(MethodArgumentNotValidException e) {
var errorList = e.getFieldErrors();
String errorListAsString = errorList.stream().map(fieldError -> fieldError.getField() + ": " + fieldError.getDefaultMessage()).collect(Collectors.joining(", "));
return new ErrorMessage(OffsetDateTime.now(), String.format("You have empty/wrong formatted parameters: \n %s", errorListAsString));
return new ErrorMessage(OffsetDateTime.now(), String.format("You have empty/wrong formatted parameters: %s", errorListAsString));
}
}