Merge pull request #2154 from balena-os/log-uncaught-exceptions

Log uncaught promise exceptions on the app entry
This commit is contained in:
flowzone-app[bot] 2023-04-10 18:14:37 +00:00 committed by GitHub
commit 8259dae691
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -136,4 +136,9 @@ process.on('SIGTERM', () => {
});
const supervisor = new Supervisor();
supervisor.init();
supervisor.init().catch((e) => {
log.error('Uncaught exception:', e);
// Terminate the process to avoid leaving the supervisor in a bad state
process.exit(1);
});