fix: fix worker event error handling
authorJérôme Benoit <jerome.benoit@sap.com>
Mon, 5 Feb 2024 21:56:31 +0000 (22:56 +0100)
committerJérôme Benoit <jerome.benoit@sap.com>
Mon, 5 Feb 2024 21:56:31 +0000 (22:56 +0100)
Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>
src/charging-station/Bootstrap.ts

index 98cadb845dd933dc48438c5c7010347d4a071af6..07d411b59aaf763028e3a5d5ceb579e88de44177 100644 (file)
@@ -152,10 +152,10 @@ export class Bootstrap extends EventEmitter {
         )
         this.on(
           ChargingStationWorkerMessageEvents.workerElementError,
-          (msg: ChargingStationWorkerMessage<ChargingStationWorkerEventError>) => {
+          (eventError: ChargingStationWorkerEventError) => {
             logger.error(
-              `${this.logPrefix()} ${moduleName}.messageHandler: Error occurred while handling '${msg.data.event}' event on worker:`,
-              msg.data
+              `${this.logPrefix()} ${moduleName}.messageHandler: Error occurred while handling '${eventError.event}' event on worker:`,
+              eventError
             )
           }
         )