RED-5293: fixed broken IllegalArgumentException, it throws now a 400 instead of 500
This commit is contained in:
parent
9b7d1536eb
commit
d95beeae26
@ -106,4 +106,12 @@ public class ControllerAdvice {
|
||||
return new ErrorMessage(OffsetDateTime.now(), String.format("You have empty/wrong formatted parameters: %s", errorListAsString));
|
||||
}
|
||||
|
||||
@ResponseBody
|
||||
@ResponseStatus(value = HttpStatus.BAD_REQUEST)
|
||||
@ExceptionHandler(value = IllegalArgumentException.class)
|
||||
public ErrorMessage handleIllegalArgumentException(IllegalArgumentException e) {
|
||||
|
||||
return new ErrorMessage(OffsetDateTime.now(), e.getMessage());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user