diff --git a/nova/api/openstack/wsgi.py b/nova/api/openstack/wsgi.py index 0b749e115e6f..43b51b64aca7 100644 --- a/nova/api/openstack/wsgi.py +++ b/nova/api/openstack/wsgi.py @@ -77,7 +77,7 @@ class JSONDeserializer(TextDeserializer): return utils.loads(datastring) except ValueError: raise exception.MalformedRequestBody( - "malformed JSON in request body") + reason=_("malformed JSON in request body")) class XMLDeserializer(TextDeserializer): @@ -98,7 +98,7 @@ class XMLDeserializer(TextDeserializer): return {node.nodeName: self._from_xml_node(node, plurals)} except ExpatError: raise exception.MalformedRequestBody( - "malformed XML in request Body") + reason=_("malformed XML in request body")) def _from_xml_node(self, node, listnames): """Convert a minidom node to a simple Python type. diff --git a/nova/exception.py b/nova/exception.py index ffd88fbe79d6..f3a452228cf4 100644 --- a/nova/exception.py +++ b/nova/exception.py @@ -588,4 +588,4 @@ class MigrationError(NovaException): class MalformedRequestBody(NovaException): - message = _("Malformed message body") + ": %(reason)s" + message = _("Malformed message body: %(reason)s")