Merge pull request #3880 from elliott-king/patch-2

Docs update: clarify json error handling
This commit is contained in:
David Lord 2021-01-27 10:00:02 -08:00 committed by GitHub
commit d887d32f4d
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