by avolcano · 6y ago · 0 comments
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
process.on('unhandledRejection', (reason) => {
throw reason;
});
which, as long as you havent handled `uncaughtException`, prints the stack trace and aborts.In Emscripten we've had to emit a handler like that by default, so that test suites don't silently ignore errors. Being able to not emit it will avoid some code size and annoyances users have had.