diff --git a/services/web/app.mjs b/services/web/app.mjs index a6f737eb7e..5b2851b687 100644 --- a/services/web/app.mjs +++ b/services/web/app.mjs @@ -35,9 +35,14 @@ metrics.open_sockets.monitor() if (Settings.catchErrors) { process.removeAllListeners('uncaughtException') - process.on('uncaughtException', error => - logger.error({ err: error }, 'uncaughtException') - ) + process.removeAllListeners('unhandledRejection') + process + .on('uncaughtException', error => + logger.error({ err: error }, 'uncaughtException') + ) + .on('unhandledRejection', (reason, p) => { + logger.error({ err: reason }, 'unhandledRejection at Promise', p) + }) } // Create ./data/dumpFolder if needed