-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Closed
Labels
Description
https://nodejs.org/api/process.html#event-uncaughtexceptionmonitor
-
process.on("unhandledRejection", cb) -
process.on("unhandledException", cb) -
process.on("uncaughtExceptionMonitor", cb) -
process.setUncaughtExceptionCaptureCallback(cb)
This lets Sentry get error reporting working.
Ideally, the fix would go here:
Lines 629 to 640 in 7ce7f08
| pub const UnhandledRejectionScope = struct { | |
| ctx: ?*anyopaque = null, | |
| onUnhandledRejection: *const OnUnhandledRejection = undefined, | |
| count: usize = 0, | |
| pub fn apply(this: *UnhandledRejectionScope, vm: *JSC.VirtualMachine) void { | |
| vm.onUnhandledRejection = this.onUnhandledRejection; | |
| vm.onUnhandledRejectionCtx = this.ctx; | |
| vm.unhandled_error_counter = this.count; | |
| } | |
| }; | |
We would add an unhandled rejection scope for either rejections or exceptions and have some way to distinguish between the two. This one would call into JS potentially for multiple handlers. The part that gets a little tricky is in unit tests where we rely on this behavior for expect().toThrow()
cc @dcramer
maxmilton, colindotfun, evelant, nathankleyn, EllipticElysium and 20 moreMatthewArylforst, Zwimber, AbhiPrasad, silent1mezzo, dector and 23 moreotterDeveloper, rhuanbarreto, MollsReis, mathix420, masad-frost and 1 more