]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
Log stack trace for middleware faults
authorEric Harney <eharney@redhat.com>
Tue, 9 Feb 2016 16:57:32 +0000 (11:57 -0500)
committerEric Harney <eharney@redhat.com>
Tue, 9 Feb 2016 16:57:32 +0000 (11:57 -0500)
If an error occurs in the middleware layer,
such as an exception generated by keystoneclient,
there is no stack trace provided, leaving the
issue difficult to debug.

Log a stack trace here with LOG.exception instead.

Change-Id: I7bc7c74e8b701fac351572a3bb9d934c7f67d425

cinder/api/middleware/fault.py

index f667ae4d8c811ca6677b1d295dad729b38a9fa16..9aa9e6456b7176b8aebbbb06382af419ffc4f19a 100644 (file)
@@ -44,9 +44,9 @@ class FaultWrapper(base_wsgi.Middleware):
 
     def _error(self, inner, req):
         if not isinstance(inner, exception.QuotaError):
-            LOG.error(_LE("Caught error: %(type)s %(error)s"),
-                      {'type': type(inner),
-                       'error': inner})
+            LOG.exception(_LE("Caught error: %(type)s %(error)s"),
+                          {'type': type(inner),
+                           'error': inner})
         safe = getattr(inner, 'safe', False)
         headers = getattr(inner, 'headers', None)
         status = getattr(inner, 'code', 500)