|
|
|
|
|
by avolcano
2058 days ago
|
|
Glad to see "throw on unhandled rejections" make it into Node, finally! I can stop carting around this little bit of code I used in every Node API I wrote: process.on('unhandledRejection', (err) => {
console.error(err.stack);
process.exit(1);
});
Had become as second-nature for me as "set -euo pipefail". |
|
we instead use
which, as long as you havent handled `uncaughtException`, prints the stack trace and aborts.