This causes a fault such as the following to log the type:
ERROR cinder.api.middleware.fault [req-7d2... ddf... 658...]
Caught error: <class 'oslo_db.exception.DBDataError'> (pymysql.err.InternalError)
(1366, u"Incorrect string value: '\\xF0\\x9F\\x8C\\x8B' for column 'display_name'
at row 1") [SQL: u'INSERT...
Without this info (DBDataError), it is rather difficult to
determine which exception actually occurred.
Change-Id: I51ca64847b7d82c4258e134161e1b23f232004e5
def _error(self, inner, req):
if not isinstance(inner, exception.QuotaError):
- LOG.error(_LE("Caught error: %s"), inner)
+ LOG.error(_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)