From 8a95a531235a43e08381371be45d1bb5889c4e44 Mon Sep 17 00:00:00 2001 From: Stanislav Trailov Date: Tue, 30 Jan 2024 14:25:57 +0200 Subject: [PATCH] Return bad request when illegal argument is thrown (#1574) Signed-off-by: TRS1SF3 --- .../hawkbit/rest/exception/ResponseExceptionHandler.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hawkbit-rest/hawkbit-rest-core/src/main/java/org/eclipse/hawkbit/rest/exception/ResponseExceptionHandler.java b/hawkbit-rest/hawkbit-rest-core/src/main/java/org/eclipse/hawkbit/rest/exception/ResponseExceptionHandler.java index b8d07ddf5..5a46295e5 100644 --- a/hawkbit-rest/hawkbit-rest-core/src/main/java/org/eclipse/hawkbit/rest/exception/ResponseExceptionHandler.java +++ b/hawkbit-rest/hawkbit-rest-core/src/main/java/org/eclipse/hawkbit/rest/exception/ResponseExceptionHandler.java @@ -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 handleExceptionCausedByIncorrectRequestBody(final HttpServletRequest request, final Exception ex) { logRequest(request, ex);