-
Notifications
You must be signed in to change notification settings - Fork 28
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
Add includeFailed to takeWhile #151
Conversation
c.doneOrClosed().discard | ||
false | ||
case ChannelClosed.Error(r) => | ||
c.errorOrClosed(r).discard |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
question: Should we ignore if erroring the channel wasn't successful? (here, and in the catch below as well). This is unexpected, but in case of bugs we'd lose the original error. I saw such approach in other ox functions.
Edit:
Following up on this: isn't channel.error(e)
problematic in general, because it loses the original e
if erroring fails?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the channel is already in an error, the original error will remain. If that's the case, .errorOrClose
will return the original one, and do nothing else
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we'd lose the original error.
sorry, bad wording, I didn't mean the original error but the "next error". I guess the only alternative is to combine errors, throw and tear down the entire scope, which sounds like a bad idea in this case.
BUT, apart from this case, in case of the channel.error(e)
implementation, throwing original error and ignoring e
could be improved to throwing original error with e
added to its suppressed exceptions?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But then we could run into concurrency issues. I don't think .addSuppressed
is thread-safe?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Except for exceptions, looks fine, if you need a release go ahead :)
A useful feature.