7 ms·
For debugging in Node I use: process.on("unhandledRejection", err => { console.error("Uncaught Promise Error: \n" + err.stack); console.err
by YCode 9y ago
For debugging in Node I use:
process.on("unhandledRejection", err => {
console.error("Uncaught Promise Error: \n" + err.stack);
console.error(err);
});
- mort96 9y agoThat's better than letting it get swallowed, but in my experience is pretty terrible still, as it often just results in a stack trace where your code literally doesn't exist at all. In a somewhat big project, just having a vague error message without as much as a line number is hell.