-
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
weird behaviour from uncaughtExceptionMonitor for unhandled rejections #35291
Comments
This seems to work as intended. The reason is that there's a difference between a promise rejection and an uncaught exception. The monitor only works for exceptions but not for rejections. |
What is the point of the |
Seems like the documentation should be updated for the exception monitor. It should be identical to the documentation here https://nodejs.org/api/process.html#process_event_uncaughtexception. A PR is welcome :-) |
So basically the handler will work as I expect only if I run node with a |
Just found out that the issue is basically the same as #32907 |
What steps will reproduce the bug?
What is the expected behavior?
I should see the
uncaughtExceptionMonitor handler
What do you see instead?
Additional information
If I add a handler for
unhandledRejection
that just re-throws the error like so:then the
uncaughtExceptionMonitor
is reached :(but that is now an uncaughtException and not an unhandledRejection anymore, when I come to think about it !)
Also, an exception not related to unhandled promise works as expected, i.e.:
gives me the expected
So basically it seems to me that
uncaughtExceptionMonitor
doesn't work forunhandledRejection
🤷The text was updated successfully, but these errors were encountered: