You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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 indecorators.py
, the make_response's error code is set toexc.status
, which in this case is None, if I set it toexc.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.
The text was updated successfully, but these errors were encountered: