crnk-framework
crnk-framework copied to clipboard
Invalid date in body results in a 500 error
When passing an invalid date in the request body (e.g. "birthDate" : "1992-05-32"
) a ResourceException
is thrown (ResourceUpsert.java:154
) because the date cannot be deserialized to a LocalDate. This is handled as a 500 Internal Server
error.
Shouldn't this be a 400 Bad Request
error?
yes, it should, at least a 4xx. PRs always welcome should you already have a fix in mind.
A crnk built-in ExceptionMapper
that catches (certain) JsonProcessingException
s should do the trick, no?