From: Jérôme Benoit Date: Fri, 16 Sep 2022 17:16:31 +0000 (+0200) Subject: Log unconditionally uncaughtException and unhandledRejection in X-Git-Tag: v1.1.74~32 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=4f143cd78083988165987b4eb81b7a4880df9198;p=e-mobility-charging-stations-simulator.git Log unconditionally uncaughtException and unhandledRejection in worker Signed-off-by: Jérôme Benoit --- diff --git a/src/charging-station/ChargingStationWorker.ts b/src/charging-station/ChargingStationWorker.ts index 4f109bf5..73c2cb7f 100644 --- a/src/charging-station/ChargingStationWorker.ts +++ b/src/charging-station/ChargingStationWorker.ts @@ -49,3 +49,11 @@ function startChargingStation(data: ChargingStationWorkerData): void { const station = new ChargingStation(data.index, data.templateFile); station.start(); } + +process.on('uncaughtException', (err) => { + throw err; +}); + +process.on('unhandledRejection', (reason) => { + throw reason; +});