Skip to content
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

wrong status code from jsonapi_exception_formatter #162

Open
JortdeBokx opened this issue Jun 20, 2019 · 0 comments
Open

wrong status code from jsonapi_exception_formatter #162

JortdeBokx opened this issue Jun 20, 2019 · 0 comments

Comments

@JortdeBokx
Copy link
Contributor

When I make a POST request to an endpoint with an empty body, the jsonapi_exception_formatter decorator returns an exception with status code 500 instead of 400.
This only happens when app.config['DEBUG'] = False.

I found that the reason this happens is because in the jsonapi_exception_formatter function in decorators.py, the make_response's error code is set to exc.status, which in this case is None, if I set it to exc.code, it works as expected, returning an HTTP error with status code 400.

I'm not sure whether it's just me or whether this should be changed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant