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: I4c6cb80a6311c081a30130ba51b8e5d7a88331b2 Closes-Bug: #1587849
This commit is contained in:
parent
2bcf3818bb
commit
f087573431
|
@ -100,7 +100,7 @@ def factory(global_config, **local_conf):
|
|||
return response
|
||||
|
||||
for code in six.iterkeys(wexceptions.default_exceptions):
|
||||
app.error_handler_spec[None][code] = _json_error
|
||||
app.register_error_handler(code, _json_error)
|
||||
|
||||
# TODO(kiall): Ideally, we want to make use of the Plugin class here.
|
||||
# This works for the moment though.
|
||||
|
|
Loading…
Reference in New Issue