Skip to content
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 callbacks silently allow exceptions #16434

Closed
grantila opened this issue Oct 24, 2017 · 3 comments
Closed

http2 callbacks silently allow exceptions #16434

grantila opened this issue Oct 24, 2017 · 3 comments
Labels
http2 Issues or PRs related to the http2 subsystem.

Comments

@grantila
Copy link

  • Version: 8.4-8.7
  • Subsystem: http2

When throwing an exception in a callback handler (e.g. in response), http2 silently does nothing, except it emits streamClosed with an errorCode of NGHTTP2_NO_ERROR.

Expected behaviour; if I throw at http2, log to stderr, then kill the process

@jasnell jasnell added the http2 Issues or PRs related to the http2 subsystem. label Oct 24, 2017
@jasnell
Copy link
Member

jasnell commented Oct 24, 2017

Well that's not good is it :-) ... will investigate!
/cc @mcollina @apapirovski

@apapirovski
Copy link
Member

Hmmmm... I can't seem to replicate this. Can you post some sample code?

@grantila
Copy link
Author

Ugh, this happened when running unit tests with mocha, I never did a simple standalone test, although I obviously should have.

After having investigated a bit now, I realize that mocha sets an 'uncaughtException' handler which swallows the error and continues execution (contrary to what the Node.js documentation tells you to do). By removing all 'uncaughtException' handlers when running the same test within mocha, I get the correct behavior; stderr + process exit.

Since this is a mocha issue and not http2 (or Node.js for that mattter), I'll close this issue. Sorry for wasting your time 😔

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
http2 Issues or PRs related to the http2 subsystem.
Projects
None yet
Development

No branches or pull requests

3 participants