summaryrefslogtreecommitdiff
path: root/taskflow/patterns
diff options
context:
space:
mode:
authorIvan A. Melnikov <imelnikov@griddynamics.com>2014-01-14 13:49:20 +0400
committerIvan A. Melnikov <imelnikov@griddynamics.com>2014-01-14 14:06:33 +0400
commit9d0b16e7fb46f4d136de52e1c2c6114616341bf8 (patch)
tree0131a335a31d35ed23b36762419fac7911ed1922 /taskflow/patterns
parent135f562408e8baa81016da9ac55ea40eda174757 (diff)
downloadtaskflow-9d0b16e7fb46f4d136de52e1c2c6114616341bf8.tar.gz
Exceptions cleanup
Most TaskFlow exception don't have 'Exception' suffix in their names, so we drop it from the few that have it, for sake of consistency and more concise and expressive code. MissingDependencies parent object is changed from InvalidState to InvariantViolation, which is more appropriate. Unused ClosedException is dropped. Breaking change: any client code that used renamed exceptions, ClosedException or relied on catching MissingDependencies as InvariantViolationException is affected. Change-Id: I649b7760d382ccb6df333bdffd667ba6b67a431e
Diffstat (limited to 'taskflow/patterns')
-rw-r--r--taskflow/patterns/linear_flow.py2
-rw-r--r--taskflow/patterns/unordered_flow.py4
2 files changed, 3 insertions, 3 deletions
diff --git a/taskflow/patterns/linear_flow.py b/taskflow/patterns/linear_flow.py
index 9f85efe..6864fbe 100644
--- a/taskflow/patterns/linear_flow.py
+++ b/taskflow/patterns/linear_flow.py
@@ -45,7 +45,7 @@ class Flow(flow.Flow):
requires |= item.requires
out_of_order = requires & item.provides
if out_of_order:
- raise exceptions.InvariantViolationException(
+ raise exceptions.InvariantViolation(
"%(item)s provides %(oo)s that are required "
"by previous item(s) of linear flow %(flow)s"
% dict(item=item.name, flow=self.name,
diff --git a/taskflow/patterns/unordered_flow.py b/taskflow/patterns/unordered_flow.py
index 200fbdd..328fcad 100644
--- a/taskflow/patterns/unordered_flow.py
+++ b/taskflow/patterns/unordered_flow.py
@@ -47,7 +47,7 @@ class Flow(flow.Flow):
item_provides = item.provides
bad_provs = item_provides & old_requires
if bad_provs:
- raise exceptions.InvariantViolationException(
+ raise exceptions.InvariantViolation(
"%(item)s provides %(oo)s that are required "
"by other item(s) of unordered flow %(flow)s"
% dict(item=item.name, flow=self.name,
@@ -65,7 +65,7 @@ class Flow(flow.Flow):
for item in items:
bad_reqs = provides & item.requires
if bad_reqs:
- raise exceptions.InvariantViolationException(
+ raise exceptions.InvariantViolation(
"%(item)s requires %(oo)s that are provided "
"by other item(s) of unordered flow %(flow)s"
% dict(item=item.name, flow=self.name,