refactor(simulator): move main process unhandled or uncaught error
authorJérôme Benoit <jerome.benoit@sap.com>
Thu, 2 Feb 2023 20:15:08 +0000 (21:15 +0100)
committerJérôme Benoit <jerome.benoit@sap.com>
Thu, 2 Feb 2023 20:15:08 +0000 (21:15 +0100)
     logging at initialization

Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>
.cfignore
src/charging-station/Bootstrap.ts

index f23ccd1462c60e987138f5f19bf47c8d28a8ebc6..b72ef9526935d944806e6137b197b97bbccee577 100644 (file)
--- 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
index 2bf7159539988aca847ea9d60539542dc65ddbab..b14952436e4c6a3ddd008760897301c5d80b4e62 100644 (file)
@@ -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<void> {
     if (isMainThread && this.started === false) {
       try {
-        // Enable unconditionally for now
-        this.logUnhandledRejection();
-        this.logUncaughtException();
         this.initializeCounters();
         this.initializeWorkerImplementation();
         await this.storage?.open();