-
Notifications
You must be signed in to change notification settings - Fork 140
Description
Jane version(s) affected: 7.4.0
Description
Exceptions do not contain server response body thus not allowing to understand what exactly went wrong during the request.
E.g. we're trying to create some resource, but server-side validation of some field failed and the server returned a 422
response. Jane would throw an UnprocessableEntityException
that we can catch in our client code, but we can't show the user what exactly went wrong because we don't have access to the response body, containing that information.
I'm not sure whether something's wrong with my OpenAPI specification, but exception classes that are generated by Jane only contain the Unprocessable entity
message and nothing else.
How to reproduce
- Send
POST /collection
with payload that would cause422
error. - Catch
UnprocessableEntityException
. - Try to render human-readable error message with details of which particular field is invalid and why.
Possible Solution
I believe exceptions must contain a response body with error details at least in raw format in case there's no easy way to standardize it.