Skip to content

Conversation

mjohnson12
Copy link
Collaborator

Added catch for errors in AsyncSequenceWorker.

Checklist

  • Unit Tests
  • UI Tests
  • Snapshot Tests (iOS only)
  • I have made corresponding changes to the documentation

Added catch for errors in AsyncSequenceWorker.
@mjohnson12 mjohnson12 requested a review from a team as a code owner June 30, 2025 19:10
sink.send(AnyWorkflowAction(sendingOutput: output))
}
} catch {
fatalError("AsyncSequenceWorker implementations should not throw errors on iteration: \(error)")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would it be possible to add where Sequence.Failure == Never to the associatedtype declaration to codify that we expect a worker's run function to return a sequence that never fails?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No because Failure is iOS 18+ on AsyncSequence. We did try that.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ugh. that sucks. saw the comment about the any AsyncSequence<Element, Failure> but thought maybe that was something else

@mjohnson12 mjohnson12 merged commit 175e690 into main Jun 30, 2025
8 checks passed
@mjohnson12 mjohnson12 deleted the markj/add_fatal_error_for_iteration_errors branch June 30, 2025 20:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants