-
Notifications
You must be signed in to change notification settings - Fork 76
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Web API crashes when there's a variable's period mismatch #916
Comments
@sandcha It seems to me like part of this has been fixed in the PR #993. Running this example now renders:
Same goes for |
@sandcha So far I have not found a way to intercept the ValueError as a 400 error instead of a 500. So far the 500 internal error explains the origin of the error but does not imply it's a user error. I believe one way to correct it would be to define a new error class, to substitute the built-in ValueError, that can be intercepted and introspected. |
Yes! #993 allows for proper "catch-all" handling: returning a 500 instead of just crashing. |
Hello @maukoquiroga ! The issue here is that technically the error rendered should be a code 400, because it's a user error, instead of a 500 error. Getting a 500 Internal Server Error leads to believe that the error generated from the server which is not the case here. |
Hi there!
I really enjoy OpenFisca, but I recently encountered an issue.
Here is what I did:
I sent a json situation to
/calculate
Web API endpoint.I used
openfisca_france
v48.9.2 module and, in aFamille
entity, I asked for:Here is what I expected to happen:
Code
400
forERROR: BAD REQUEST
with something like:As we get this type of response when there is an entity mismatch (when we ask for a variable value in the wrong entity section).
Here is what actually happened:
🙀 Code
500
forError: Internal Server Error
and:Here is data (or links to it) that can help you reproduce this issue:
Context
I identify more as a:
The text was updated successfully, but these errors were encountered: