You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jun 18, 2021. It is now read-only.
Repository navigation
This repository was archived by the owner on Jun 18, 2021. It is now read-only.
can something useful be reported about unhandled rejections? #75
I was thinking specifically of the list of all promises that are currently rejected but do not have error handlers attached. Basically what the unhandledRejection event emits. However, it emits it after one "turn of the event loop" (an ill defined concept). Those promises may get an error handler attached sometime later... or may not, and their presence at time of node report may be interesting, if we know something about them that is reportable.
Hmmm, so I think this means hooking into v8::Isolate::SetPromiseRejectCallback() but that also then means we hijack core's handler...
So we might either have to add a c++ node api for that, or polyfill the node behavior from here...
Also, on shutdown we'd need to synchronously extract the "reason" data. Not too terribly difficult with the debug api, but very hacky and, well, the V8 people are not a fan of people using it.
https://nodejs.org/api/process.html#process_event_unhandledrejection and the mention of a "PromiseHook C++ API" (nodejs/node#11752) sparked my curiousity, its an interesting thing to know about an applications state.