From: Jérôme Benoit Date: Thu, 2 Feb 2023 20:15:08 +0000 (+0100) Subject: refactor(simulator): move main process unhandled or uncaught error X-Git-Tag: v1.1.93~22 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=4724a293231a0cec198f85aa8af9aa0564bbd542;p=e-mobility-charging-stations-simulator.git refactor(simulator): move main process unhandled or uncaught error logging at initialization Signed-off-by: Jérôme Benoit --- 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();