exc_filters: Do not reraise
We're seeing a weird condition whereby the exceptions raised by our exception handler and being "rehandled", resulting in 'DBError' being raised instead of e.g. 'DBReferenceError'. This is hard to reproduce and thus far has only be spotted in Barbican unit tests. Prevent the issue by checking if the exception being handled is one of our own and skip handling it if so. Change-Id: Ibd3f665a3ed3aedf9d1f33edcab35a46c27ea3dc Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
This commit is contained in:
parent
6285f2b4e2
commit
8dcd47383d
@ -430,6 +430,10 @@ def handler(context):
|
||||
if '*' in _registry:
|
||||
yield _registry['*']
|
||||
|
||||
# do not reraise for our own exceptions
|
||||
if isinstance(context.original_exception, exception.DBError):
|
||||
return
|
||||
|
||||
dialect = compat.dialect_from_exception_context(context)
|
||||
for per_dialect in _dialect_registries(dialect):
|
||||
for exc in (context.sqlalchemy_exception, context.original_exception):
|
||||
|
Loading…
x
Reference in New Issue
Block a user