]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commit
API Middleware fault: Log exception type
authorEric Harney <eharney@redhat.com>
Mon, 11 Jan 2016 20:22:25 +0000 (15:22 -0500)
committerEric Harney <eharney@redhat.com>
Tue, 12 Jan 2016 14:37:44 +0000 (09:37 -0500)
commit68a0f1c309c01bf6f8bbe6e0e08e3e292fec61b6
tree7080c603db7ffb056b1ec65a568d46beb4bd012b
parent81f7986c16ecd589017486e60fb39544c5c409a8
API Middleware fault: Log exception type

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
cinder/api/middleware/fault.py