summaryrefslogtreecommitdiffstats
path: root/nova/api
diff options
context:
space:
mode:
Diffstat (limited to 'nova/api')
-rw-r--r--nova/api/openstack/wsgi.py13
1 files changed, 5 insertions, 8 deletions
diff --git a/nova/api/openstack/wsgi.py b/nova/api/openstack/wsgi.py
index f7e8d0c6a..79382d864 100644
--- a/nova/api/openstack/wsgi.py
+++ b/nova/api/openstack/wsgi.py
@@ -651,11 +651,12 @@ class ResourceExceptionHandler(object):
return True
if isinstance(ex_value, exception.NotAuthorized):
- msg = unicode(ex_value)
+ msg = unicode(ex_value.message % ex_value.kwargs)
raise Fault(webob.exc.HTTPForbidden(explanation=msg))
elif isinstance(ex_value, exception.Invalid):
+ msg = unicode(ex_value.message % ex_value.kwargs)
raise Fault(exception.ConvertedException(
- code=ex_value.code, explanation=unicode(ex_value)))
+ code=ex_value.code, explanation=msg))
# Under python 2.6, TypeError's exception value is actually a string,
# so test # here via ex_type instead:
@@ -1158,12 +1159,8 @@ class Fault(webob.exc.HTTPException):
code = self.wrapped_exc.status_int
fault_name = self._fault_names.get(code, "computeFault")
explanation = self.wrapped_exc.explanation
- offset = explanation.find("Traceback")
- if offset is not -1:
- LOG.debug(_("API request failed, fault raised to the top of"
- " the stack. Detailed stacktrace %s") %
- explanation)
- explanation = explanation[0:offset - 1]
+ LOG.debug(_("Returning %(code)s to user: %(explanation)s"),
+ {'code': code, 'explanation': explanation})
fault_data = {
fault_name: {