-
Notifications
You must be signed in to change notification settings - Fork 147
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
consume not passing errors #136
Comments
This has nothing to do with |
Indeed, there are 2 branches in
@LewisJEllis the fact that pipe re-emits the error is what is coded but when only working with highland streams it feels unnatural to me. This part probably comes from interactions with native node streams and I am not what we should target for the implementation. |
Pipe could certainly take a shortcut when dealing only with highland streams. This is related to the idea I had here before realizing that the function branch is enough for that usage. It would make piping between highland streams faster/simpler, but what are the drawbacks? |
I think the current situation comes from the fact that The documentation for through "will always return a Highland Stream (instead of the piped to target directly as in Node.js)." - http://highlandjs.org/#through this can be seen in the code where we have
Since Nevertheless, I believe such a change in behavior cannot be envisioned without a +1 from @caolan |
Yep, all makes sense, and none of that precludes this potential shortcut; it would still satisfy the agreement to work on any Node Writable Stream. Catching errors off the first pipe is an interesting idea, but certainly a significant behavior change. The shortcut would already make |
Provided we always emit an 'error' event (therefore throwing if no handler present) in the case of piping to a node stream I'm happy to add a case for piping to highland streams which passes the error downstream as you might expect. So @jeromew that's a +1 ;) - we'll have to decide if this constitutes a major version bump though. |
I've been thinking about this because of the PR that @svozza recently submitted. Isn't the problem here that " It seems to me that Isn't it weird behavior to have some node writable streams throw and some don't (highland streams) when passed to |
I think not changing |
+1; one sticking point was the inconsistency between hl#pipe and node#pipe, and this change would unify that behavior /and/ solve the original problem with through. |
Given the code below, I except the console.error to output. Instead, the error is thrown (see error below)
The text was updated successfully, but these errors were encountered: