summaryrefslogtreecommitdiffstats
path: root/nova/api
diff options
context:
space:
mode:
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)