docs "Returning API Errors as JSON" return correct status code

This commit is contained in:
LarsMoons 2022-04-08 17:45:44 +02:00 committed by David Lord
parent b9729a0879
commit e3c014f9aa
No known key found for this signature in database
GPG key ID: 7A1C87E3F5BC42A8

View file

@ -489,7 +489,7 @@ This is a simple example:
@app.errorhandler(InvalidAPIUsage)
def invalid_api_usage(e):
return jsonify(e.to_dict())
return jsonify(e.to_dict()), e.status_code
# an API app route for getting user information
# a correct request might be /api/user?user_id=420