-
Notifications
You must be signed in to change notification settings - Fork 29.8k
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
stream: throw
instead of destroy
?
#33192
Comments
throws
instead of destroy
?throw
instead of destroy
?
This has been discussed a few times in the past. Most recently in #31818. Some refs: |
It's a case of logic (throw) vs runtime (destroy) errors. |
Thank you for the quick response, ronag! Quoting @mscdex from #31818 (review),
I'll work on a PR soon to ensure that this logic is implemented in streams (and HTTP[s]\1\2). |
Please note that this is not currently the consensus. Throwing is not always preferred. Please read the rest of the discussion. |
I am closing this as there does not seem anything in particular actionable. |
I've come across multiple instances (in http2, for example) where due to a condition not being fulfilled, an error was thrown rather than destroying the stream itself (which would emit an error event and hence would be easier to work with).
I wanted to know if there's any reason behind not destroying the stream, or if this needs to be fixed?
The text was updated successfully, but these errors were encountered: