Return bad request when illegal argument is thrown (#1574)

Signed-off-by: TRS1SF3 <Stanislav.Trailov@bosch.io>
This commit is contained in:
Stanislav Trailov
2024-01-30 14:25:57 +02:00
committed by GitHub
parent 53196ef680
commit 8a95a53123

View File

@@ -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);