Skip to content

Commit 8f27f7c

Browse files
authored
fix: isCancellation no longer scans chain recursively (#837)
1 parent 132f23a commit 8f27f7c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

packages/workflow/src/errors.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ export function isCancellation(err: unknown): boolean {
2525
if (!looksLikeError(err)) return false;
2626
return (
2727
err.name === 'CancelledFailure' ||
28-
((err.name === 'ActivityFailure' || err.name === 'ChildWorkflowFailure') && isCancellation(err.cause))
28+
((err.name === 'ActivityFailure' || err.name === 'ChildWorkflowFailure') &&
29+
looksLikeError(err.cause) &&
30+
err.cause.name === 'CancelledFailure')
2931
);
3032
}

0 commit comments

Comments
 (0)