Return bad request when illegal argument is thrown (#1574)
Signed-off-by: TRS1SF3 <Stanislav.Trailov@bosch.io>
This commit is contained in:
committed by
GitHub
parent
53196ef680
commit
8a95a53123
@@ -164,7 +164,7 @@ public class ResponseExceptionHandler {
|
||||
* @return the entity to be responded containing the exception information
|
||||
* as entity.
|
||||
*/
|
||||
@ExceptionHandler({ HttpMessageNotReadableException.class, MethodArgumentNotValidException.class })
|
||||
@ExceptionHandler({ HttpMessageNotReadableException.class, MethodArgumentNotValidException.class, IllegalArgumentException.class })
|
||||
public ResponseEntity<ExceptionInfo> handleExceptionCausedByIncorrectRequestBody(final HttpServletRequest request,
|
||||
final Exception ex) {
|
||||
logRequest(request, ex);
|
||||
|
||||
Reference in New Issue
Block a user