summaryrefslogtreecommitdiffstats
path: root/nova/api
diff options
context:
space:
mode:
authorEwan Mellor <ewan.mellor@citrix.com>2011-11-04 14:00:37 -0700
committerEwan Mellor <ewan.mellor@citrix.com>2011-11-04 14:00:37 -0700
commit01150b5d0d482a83a1065c2a6d62f4963c9f838d (patch)
treeac2fb88bb77453d7c5a4ba7742edff768e6f2eb9 /nova/api
parent67a1c257f9e4be774da5acf2c1b703d196e0a2cf (diff)
Bug #886353: Faults raised by OpenStack API Resource handlers fail to be reported properly
In Resource.__call__, catch any faults.Fault that are thrown by the request handler, and make those the action_result. This means that the Fault doesn't fall into the exception handler below (faults.Fault is a subclass of webob.exc.HTTPException) and so we don't attempt to wrap a Fault in a Fault. Change-Id: Ica31723ddd621332ec4be75db0d675bc98905e43
Diffstat (limited to 'nova/api')
-rw-r--r--nova/api/openstack/wsgi.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/nova/api/openstack/wsgi.py b/nova/api/openstack/wsgi.py
index a3ca5cd5b..9f5c7258b 100644
--- a/nova/api/openstack/wsgi.py
+++ b/nova/api/openstack/wsgi.py
@@ -564,6 +564,9 @@ class Resource(wsgi.Application):
try:
action_result = self.dispatch(request, action, args)
+ except faults.Fault as ex:
+ LOG.info(_("Fault thrown: %s"), unicode(ex))
+ action_result = ex
except webob.exc.HTTPException as ex:
LOG.info(_("HTTP exception thrown: %s"), unicode(ex))
action_result = faults.Fault(ex)