summaryrefslogtreecommitdiff
path: root/taskflow/persistence/backends/impl_memory.py
diff options
context:
space:
mode:
authorJoshua Harlow <harlowja@yahoo-inc.com>2015-02-11 18:22:20 -0800
committerJoshua Harlow <harlowja@yahoo-inc.com>2015-04-03 16:04:46 -0700
commitaa8be4b8f5f55cc4e11088dcb122b34345f56cec (patch)
treea46a6e3845de3ed22dfdfe8a14be2934681cca86 /taskflow/persistence/backends/impl_memory.py
parent97c170473011e24da5481d2e3fd82bf8e6778bed (diff)
downloadtaskflow-aa8be4b8f5f55cc4e11088dcb122b34345f56cec.tar.gz
Use the ability to chain exceptions correctly
In the zookeeper jobboard (and persistence backends) we are associating the cause of a new exception when raising a exception. Using the new exception helper we can make this work better on py2.x and py3.x so that the py3.x version has the chain setup correctly (while the py2.x version just uses the class 'cause' attribute instead). Change-Id: Ieeac2f70e1834d4612556565762ffd3be3e5b5a1
Diffstat (limited to 'taskflow/persistence/backends/impl_memory.py')
-rw-r--r--taskflow/persistence/backends/impl_memory.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/taskflow/persistence/backends/impl_memory.py b/taskflow/persistence/backends/impl_memory.py
index 7efe6ec..0157fcf 100644
--- a/taskflow/persistence/backends/impl_memory.py
+++ b/taskflow/persistence/backends/impl_memory.py
@@ -209,10 +209,11 @@ class Connection(path_based.PathBasedConnection):
with lock():
try:
yield
- except exc.TaskFlowException as e:
+ except exc.TaskFlowException:
raise
- except Exception as e:
- raise exc.StorageFailure("Storage backend internal error", e)
+ except Exception:
+ exc.raise_with_cause(exc.StorageFailure,
+ "Storage backend internal error")
def _join_path(self, *parts):
return pp.join(*parts)