Correct reraising of exception
when an exception was caught and rethrown, it should call 'raise' without any arguments. Change-Id: Ie7905e47e91547601ae78abf3a6e135a0f8ac2d6
This commit is contained in:
parent
592cf2ec28
commit
26fb788b47
@ -49,13 +49,13 @@ class KeystoneEventConsumer(resources.BaseTask):
|
||||
self.db_start()
|
||||
super(KeystoneEventConsumer, self).process(*args, **kwargs)
|
||||
self.db_commit()
|
||||
except Exception as e:
|
||||
except Exception:
|
||||
"""Exceptions that reach here needs to revert the entire
|
||||
transaction.
|
||||
No need to log error message as its already done earlier.
|
||||
"""
|
||||
self.db_rollback()
|
||||
raise e
|
||||
raise
|
||||
finally:
|
||||
self.db_clear()
|
||||
|
||||
|
@ -91,11 +91,11 @@ class BaseTask(object):
|
||||
# Retrieve the target entity (such as an models.Order instance).
|
||||
try:
|
||||
entity = self.retrieve_entity(*args, **kwargs)
|
||||
except Exception as e:
|
||||
except Exception:
|
||||
# Serious error!
|
||||
LOG.exception(u._LE("Could not retrieve information needed to "
|
||||
"process task '%s'."), name)
|
||||
raise e
|
||||
raise
|
||||
|
||||
# Process the target entity.
|
||||
try:
|
||||
@ -119,10 +119,10 @@ class BaseTask(object):
|
||||
# Handle successful conclusion of processing.
|
||||
try:
|
||||
self.handle_success(entity, result, *args, **kwargs)
|
||||
except Exception as e:
|
||||
except Exception:
|
||||
LOG.exception(u._LE("Could not process after successfully "
|
||||
"executing task '%s'."), name)
|
||||
raise e
|
||||
raise
|
||||
|
||||
return result
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user