Make registering error handlers compliant with Flask 0.11

With Flask 0.11 setting error handlers by directly modifying
app.error_handler_spec dictionary leads to AttributeErrors.
It should be done by using register_error_handler method or
errorhandler decorator.

Change-Id: I2f41ab2b9ea8c4a964b16acdf77def1b08b64a6e
Closes-Bug: #1587849
This commit is contained in:
Elena Ezhova 2016-06-01 16:27:16 +03:00
parent f629671974
commit 685f7c17fd
1 changed files with 1 additions and 1 deletions

View File

@ -37,7 +37,7 @@ def make_json_error(ex):
for code in six.iterkeys(exceptions.default_exceptions):
app.error_handler_spec[None][code] = make_json_error
app.register_error_handler(code, make_json_error)
@app.route('/' + api_server.VERSION +