summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorElena Ezhova <eezhova@mirantis.com>2016-06-01 16:51:03 +0300
committerGraham Hayes <graham.hayes@hpe.com>2016-06-01 17:43:42 +0000
commitf0875734311ee3d4f9ed03cdf855a78df1906e92 (patch)
treeb53deb0a6f5fb7eb6ff37a809dd40398ac369c7c
parent2bcf3818bbabfa15212b7fc97bd8f84b5f38e2c0 (diff)
downloaddesignate-f0875734311ee3d4f9ed03cdf855a78df1906e92.tar.gz
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
-rw-r--r--designate/api/v1/__init__.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/designate/api/v1/__init__.py b/designate/api/v1/__init__.py
index 812d6767..d285b746 100644
--- a/designate/api/v1/__init__.py
+++ b/designate/api/v1/__init__.py
@@ -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.