chore: Log uncaught exceptions

This commit is contained in:
Joachim Van Herwegen 2022-10-07 13:50:52 +02:00
parent b95315c9af
commit 76248b9e16

View File

@ -1,3 +1,10 @@
#!/usr/bin/env node
const { AppRunner } = require('..');
// Attaching a logger to the uncaughtExceptionMonitor event,
// such that the default uncaughtException behavior still occurs.
process.on('uncaughtExceptionMonitor', (err, origin) => {
console.error(`Process is halting due to an ${origin} with error ${err.message}`);
});
new AppRunner().runCliSync(process);