Merge "Correct reraising of exception"

This commit is contained in:
Jenkins authored and Gerrit Code Review committed 2016-07-10 04:46:25 +00:00
commit 48bb77cf52
2 files changed
+6 -6

No files matched your search

+2 -2
View File
@@ -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()
+4 -4
View File
@@ -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