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.
Activity
Fishrock123 commentedon Mar 13, 2017
What kind of thing are you hoping for?
Fishrock123 commentedon Mar 13, 2017
like "these rejections happened before the crash" or something?
Fishrock123 commentedon Mar 20, 2017
ping @sam-github
sam-github commentedon Mar 20, 2017
I was thinking specifically of the list of all promises that are currently rejected but do not have error handlers attached. Basically what the
unhandledRejectionevent 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.Fishrock123 commentedon Mar 21, 2017
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.