Pull request #561: RED-5293: fixed broken IllegalArgumentException, it throws now a 400 instead of 500
Merge in RED/persistence-service from RED-5293 to master * commit 'd95beeae269e2dac54dad9b8309bf1bb8ffe6811': RED-5293: fixed broken IllegalArgumentException, it throws now a 400 instead of 500
This commit is contained in:
commit
9af4ad1867
@ -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