-
Notifications
You must be signed in to change notification settings - Fork 29.9k
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
http2 - compat request forward error #15359
Comments
@nodejs/http2 @phouri and @apapirovski |
Ref: #14991 I am a bit lost, can you make a full example? I think the behavior right now is the same on both http and http2. |
@mcollina: I don't see how/where the This is how it worked before, https://github.com/nodejs/node/blob/v8.4.0-proposal/lib/internal/http2/compat.js#L61, which forwarded the error on the request object but could lead to uncaught exception errors. |
@ronag I am still lost. Can you make an example (broken) on how it should behave and what you would expect? Can you show the same example using http so that I understand the difference? |
Following |
I'm not able to create a small enough repo. This is the commit I'm talking about: Where this change was made:
Previously the error was forwarded through: request.emit('error', error) However, that was removed and if you read the comment it seems to imply that the error will only be forwarded to
So if I want "correct" behavior I would have to do in userland: (req.stream || req).on('error', onError) |
That behavior is lifted from The code linked has a typo, the correct event name is (req.stream || req).on('error', onError) You shouldn't need to to that at all. Why do you need to track down the error in this way? Why do you need to do that in http2 while you didn't need it in http? Bear with us, |
Makes sense!
No worries. Thank you for very patient attitude. Sorry for the issue spamming but I am also very keen on getting this working well. |
After thinking about this for a while I think we still should forward error events from the stream object. However, only if there is an event listener as to avoid uncaught errors.
Otherwise we end up with hacks like this:
The text was updated successfully, but these errors were encountered: