summaryrefslogtreecommitdiffstats
path: root/nova/api
diff options
context:
space:
mode:
Diffstat (limited to 'nova/api')
-rw-r--r--nova/api/openstack/wsgi.py11
1 files changed, 10 insertions, 1 deletions
diff --git a/nova/api/openstack/wsgi.py b/nova/api/openstack/wsgi.py
index 33db3e714..a7a3823e9 100644
--- a/nova/api/openstack/wsgi.py
+++ b/nova/api/openstack/wsgi.py
@@ -881,8 +881,17 @@ class Resource(wsgi.Application):
# function. If we try to audit __call__(), we can
# run into troubles due to the @webob.dec.wsgify()
# decorator.
- return self._process_stack(request, action, action_args,
+ try:
+ return self._process_stack(request, action, action_args,
content_type, body, accept)
+ except expat.ExpatError:
+ msg = _("Invalid XML in request body")
+ return Fault(webob.exc.HTTPBadRequest(explanation=msg))
+ except LookupError as e:
+ #NOTE(Vijaya Erukala): XML input such as
+ # <?xml version="1.0" encoding="TF-8"?>
+ # raises LookupError: unknown encoding: TF-8
+ return Fault(webob.exc.HTTPBadRequest(explanation=unicode(e)))
def _process_stack(self, request, action, action_args,
content_type, body, accept):