Clarify json error handling

This commit is contained in:
Elliott King 2021-01-27 12:08:02 -05:00 committed by GitHub
parent 7f206913e1
commit 7068d0983a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -270,7 +270,7 @@ at the application level using the ``request`` proxy object::
@app.errorhandler(405)
def _handle_api_error(ex):
if request.path.startswith('/api/'):
return jsonify_error(ex)
return jsonify(error=str(ex)), ex.code
else:
return ex