diff --git a/evita_external_api/evita_external_api_rest/src/main/java/io/evitadb/externalApi/rest/io/JsonRestHandler.java b/evita_external_api/evita_external_api_rest/src/main/java/io/evitadb/externalApi/rest/io/JsonRestHandler.java index 0d786cf03..ccffb7b13 100644 --- a/evita_external_api/evita_external_api_rest/src/main/java/io/evitadb/externalApi/rest/io/JsonRestHandler.java +++ b/evita_external_api/evita_external_api_rest/src/main/java/io/evitadb/externalApi/rest/io/JsonRestHandler.java @@ -67,7 +67,7 @@ protected CompletableFuture parseRequestBody(@Nonnull RestEndpointExecuti try { return restHandlingContext.getObjectMapper().readValue(content, dataClass); } catch (JsonProcessingException e) { - throw new RestInternalError("Could not parse request body: ", e); + throw new RestInvalidArgumentException("Invalid request body: " + e.getLocation().toString(), e); } }); }