Skip to content

Commit 955b4c8

Browse files
committed
feat(unrelated): WorkflowExecutionAlreadyStartedError
Signed-off-by: Yves Bastide <[email protected]>
1 parent 78cdbe7 commit 955b4c8

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

simpleflow/swf/mapper/exceptions.py

+2-4
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ class RateLimitExceededError(SWFError):
105105
pass
106106

107107

108-
class WorkflowExecutionAlreadyStarted(SWFError):
108+
class WorkflowExecutionAlreadyStartedError(SWFError):
109109
pass
110110

111111

@@ -178,9 +178,7 @@ def wrapped(error, *args, **kwargs):
178178
raise ValueError(f"cannot extract resource from {error}")
179179

180180
message = extract_message(error)
181-
has_nested_resource = match_equals(
182-
REGEX_UNKNOWN_RESOURCE, message, ("type", "execution")
183-
)
181+
has_nested_resource = match_equals(REGEX_UNKNOWN_RESOURCE, message, ("type", "execution"))
184182
if has_nested_resource:
185183
matching = match_equals(REGEX_NESTED_RESOURCE, message, resource)
186184
else:

simpleflow/swf/mapper/models/workflow.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
AlreadyExistsError,
1414
DoesNotExistError,
1515
ResponseError,
16-
WorkflowExecutionAlreadyStarted,
16+
WorkflowExecutionAlreadyStartedError,
1717
extract_error_code,
1818
extract_message,
1919
raises,
@@ -223,7 +223,7 @@ def upstream(self) -> WorkflowType:
223223
@exceptions.catch(
224224
ClientError,
225225
raises(
226-
WorkflowExecutionAlreadyStarted,
226+
WorkflowExecutionAlreadyStartedError,
227227
when=lambda error, *args, **kwargs: extract_error_code(error) == "WorkflowExecutionAlreadyStartedFault",
228228
extract=lambda *args, **kwargs: "",
229229
),

0 commit comments

Comments
 (0)