Skip to content

Commit 717e36c

Browse files
committed
Move other exception to new exceptions file
1 parent 4c14ff8 commit 717e36c

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

durabletask/internal/exceptions.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
class VersionFailureException(Exception):
2+
pass
3+
4+
15
class AbandonOrchestrationError(Exception):
26
def __init__(self, *args: object) -> None:
37
super().__init__(*args)

durabletask/worker.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -90,10 +90,6 @@ class VersionFailureStrategy(Enum):
9090
FAIL = 2
9191

9292

93-
class VersionFailureException(Exception):
94-
pass
95-
96-
9793
class VersioningOptions:
9894
"""Configuration options for orchestrator and activity versioning.
9995
@@ -994,7 +990,7 @@ def execute(
994990
f"Error action = '{self._registry.versioning.failure_strategy}'. "
995991
f"Version error = '{version_failure}'"
996992
)
997-
raise VersionFailureException
993+
raise pe.VersionFailureException
998994

999995
# Get new actions by executing newly received events into the orchestrator function
1000996
if self._logger.level <= logging.DEBUG:
@@ -1006,7 +1002,7 @@ def execute(
10061002
for new_event in new_events:
10071003
self.process_event(ctx, new_event)
10081004

1009-
except VersionFailureException as ex:
1005+
except pe.VersionFailureException as ex:
10101006
if self._registry.versioning and self._registry.versioning.failure_strategy == VersionFailureStrategy.FAIL:
10111007
if version_failure:
10121008
ctx.set_failed(version_failure)

0 commit comments

Comments
 (0)