Why are AsyncThrowingStream
helpers constrained to Failure == Swift.Error
?
#38
-
hi @stephencelis and @mbrandonw 👋🏼 Could you please share the reasoning for the Is there any limitation around using custom error types? I have a faint idea of having read about it somewhere, but I've searched the documentation, GH repos and git history and found no reference of that. Apologies if I missed it. If there's a limitation then I guess it would be good if it were documented. Otherwise, does it make sense for this restriction be lifted? Thanks! 🙇🏼 |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
@p4checo We're following Apple's lead here: https://developer.apple.com/documentation/swift/asyncthrowingstream/init(_:bufferingpolicy:_:) They're generic over |
Beta Was this translation helpful? Give feedback.
@p4checo We're following Apple's lead here: https://developer.apple.com/documentation/swift/asyncthrowingstream/init(_:bufferingpolicy:_:)
They're generic over
Failure
to prepare for a future where typed throws is supported, but till then it can only be equal to theError
existential.