summaryrefslogtreecommitdiffstats
path: root/nova/api
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2012-03-06 21:02:10 +0000
committerGerrit Code Review <review@openstack.org>2012-03-06 21:02:10 +0000
commit922420faf353f0296eacee00e8c0ba372c04fbea (patch)
treefb095418bad850b84568724c3b936ce4198bcbcb /nova/api
parent31b0e17d7b5e1c3483fa84a80593c888b622e857 (diff)
parentf56cef93ea6e3746a17152bcd1850ccf4b3dad3d (diff)
Merge "Better glance exception handling"
Diffstat (limited to 'nova/api')
-rw-r--r--nova/api/openstack/compute/images.py14
1 files changed, 10 insertions, 4 deletions
diff --git a/nova/api/openstack/compute/images.py b/nova/api/openstack/compute/images.py
index 1a957bc56..eceee6651 100644
--- a/nova/api/openstack/compute/images.py
+++ b/nova/api/openstack/compute/images.py
@@ -171,8 +171,11 @@ class Controller(wsgi.Controller):
for key, val in page_params.iteritems():
params[key] = val
- images = self._image_service.index(context, filters=filters,
- **page_params)
+ try:
+ images = self._image_service.index(context, filters=filters,
+ **page_params)
+ except exception.Invalid as e:
+ raise webob.exc.HTTPBadRequest(explanation=str(e))
return self._view_builder.index(req, images)
@wsgi.serializers(xml=ImagesTemplate)
@@ -188,8 +191,11 @@ class Controller(wsgi.Controller):
page_params = common.get_pagination_params(req)
for key, val in page_params.iteritems():
params[key] = val
- images = self._image_service.detail(context, filters=filters,
- **page_params)
+ try:
+ images = self._image_service.detail(context, filters=filters,
+ **page_params)
+ except exception.Invalid as e:
+ raise webob.exc.HTTPBadRequest(explanation=str(e))
return self._view_builder.detail(req, images)