summaryrefslogtreecommitdiffstats
path: root/nova/api
diff options
context:
space:
mode:
authorChris Behrens <cbehrens@codestud.com>2012-02-28 07:34:08 +0000
committerChris Behrens <cbehrens@codestud.com>2012-02-28 07:34:08 +0000
commitfab893f333fa80567ef12f6817d52459b28c84a4 (patch)
treedfd256f735bb20b8e774fc2d9b9253a077ffe793 /nova/api
parente9b627a1c8203e5316067e79ab2a008b43b97656 (diff)
TypeError API exceptions get logged incorrectly
Fixes bug 942431 LOG.exception() always logs sys.exc_info() which does not always represent the real exception we want to log. This changes the wsgi ResourceExceptionHandler context manager to LOG.error() the traeback info that's passed to __exit__() Change-Id: I0c3728a9ee740597feb828a513aea76e7849efc6
Diffstat (limited to 'nova/api')
-rw-r--r--nova/api/openstack/wsgi.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/nova/api/openstack/wsgi.py b/nova/api/openstack/wsgi.py
index ad45284c7..8f0259024 100644
--- a/nova/api/openstack/wsgi.py
+++ b/nova/api/openstack/wsgi.py
@@ -21,7 +21,6 @@ from xml.parsers import expat
from lxml import etree
import webob
-from webob import exc
from nova import exception
from nova import log as logging
@@ -574,7 +573,9 @@ class ResourceExceptionHandler(object):
msg = unicode(ex_value)
raise Fault(webob.exc.HTTPForbidden(explanation=msg))
elif isinstance(ex_value, TypeError):
- LOG.exception(ex_value)
+ exc_info = (ex_type, ex_value, ex_traceback)
+ LOG.error(_('Exception handling resource: %s') % ex_value,
+ exc_info=exc_info)
raise Fault(webob.exc.HTTPBadRequest())
elif isinstance(ex_value, Fault):
LOG.info(_("Fault thrown: %s"), unicode(ex_value))