From 4724a293231a0cec198f85aa8af9aa0564bbd542 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Thu, 2 Feb 2023 21:15:08 +0100 Subject: [PATCH] refactor(simulator): move main process unhandled or uncaught error logging at initialization MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérôme Benoit --- .cfignore | 1 + src/charging-station/Bootstrap.ts | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.cfignore b/.cfignore index f23ccd14..b72ef952 100644 --- a/.cfignore +++ b/.cfignore @@ -49,6 +49,7 @@ manifest-*.yml *.tar.gz *.mta +commitlint.config.js rollup.config.js rollup.config.mjs mikro-orm.config.ts diff --git a/src/charging-station/Bootstrap.ts b/src/charging-station/Bootstrap.ts index 2bf71595..b1495243 100644 --- a/src/charging-station/Bootstrap.ts +++ b/src/charging-station/Bootstrap.ts @@ -51,6 +51,9 @@ export class Bootstrap { private constructor() { this.started = false; this.workerImplementation = null; + // Enable unconditionally for now + this.logUnhandledRejection(); + this.logUncaughtException(); this.workerScript = path.join( path.resolve(path.dirname(fileURLToPath(import.meta.url)), '../'), 'charging-station', @@ -78,9 +81,6 @@ export class Bootstrap { public async start(): Promise { if (isMainThread && this.started === false) { try { - // Enable unconditionally for now - this.logUnhandledRejection(); - this.logUncaughtException(); this.initializeCounters(); this.initializeWorkerImplementation(); await this.storage?.open(); -- 2.34.1