-
Notifications
You must be signed in to change notification settings - Fork 40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Making Stream error generic #32
Comments
Yes, I basically agree with you. |
Just wrote a short sketch in 3b0942a (generic-error-type branch). It works pretty well, but there are also some penalties 😓
I'm not sure how much benefit can be earned by using generic error type, |
I just find more and more that I don't like to use NSError when dealing with pure Swift code. So I thought it would be good to have errors as enums. Also I'm not sure why cancellation is treated as error. Maybe not erroring when cancelled would simplify logic? |
This is not just a
This is part of SwiftTask design, where rejection (must send Error) occurs internally while cancellation (sending Error is not necessary) takes place externally.
Above mentioned can be avoided by specifying generic |
I just bumped ver 0.12.0 and decided to replace |
Currently Streams supply generic values, but the error is cocoa NSError.
I think it would be more future-proof and user friendly to support generic errors. Many times when dealing with Swift codes, the errors are simple enums.
What do you think?
The text was updated successfully, but these errors were encountered: