Clarify json error handling
This commit is contained in:
parent
7f206913e1
commit
7068d0983a
1 changed files with 1 additions and 1 deletions
|
|
@ -270,7 +270,7 @@ at the application level using the ``request`` proxy object::
|
||||||
@app.errorhandler(405)
|
@app.errorhandler(405)
|
||||||
def _handle_api_error(ex):
|
def _handle_api_error(ex):
|
||||||
if request.path.startswith('/api/'):
|
if request.path.startswith('/api/'):
|
||||||
return jsonify_error(ex)
|
return jsonify(error=str(ex)), ex.code
|
||||||
else:
|
else:
|
||||||
return ex
|
return ex
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue