Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upGitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
Promises: Unhandled rejections #32
Comments
|
Seems like this can just be plugins for each technology. So you would wire up to Promise.onPossiblyUnhandledRejection and then submit the event from inside the handler. We are already doing something very similar here: https://github.com/exceptionless/Exceptionless.JavaScript/blob/master/src/integrations/angular.ts |
One big issue with exception handling in JavaScript is Promises: When you don't explicitly handle an error using a rejection callback, most Promise libraries provide global events like
Promise.onPossiblyUnhandledRejection(bluebird.js),Q.getUnhandledReasons(Q.js) orprocess.on('unhandledRejection)(Node.js). Not subscribing to those events when using Promises probably contributes to many programmer errors staying unnoticed, as the application won't neccessarily terminate.It would be cool if Exceptionless.js checked for the existence of such modules and events and created handlers that automatically submit the exceptions. While we do that, we should refactor all global exception handlers into implementations of an interface that can be added to the configuration like plugins.
Name proposals: