How do I handle exceptions globally with native promises in node.js?
Edit We’ve finally fixed this in Node.js 15, it took 5 years but native promise rejections now behave like uncaught exceptions – so it’s fine to just add a process.on(‘uncaughtException’ handler. In Modern Node.js Starting with io.js 1.4 and Node 4.0.0 you can use the process “unhandledRejection” event: process.on(“unhandledRejection”, function(reason, p){ console.log(“Unhandled”, reason, p); // … Read more