From 4f143cd78083988165987b4eb81b7a4880df9198 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Fri, 16 Sep 2022 19:16:31 +0200 Subject: [PATCH] Log unconditionally uncaughtException and unhandledRejection in worker MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérôme Benoit --- src/charging-station/ChargingStationWorker.ts | 8 ++++++++ 1 file changed, 8 insertions(+) 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; +}); -- 2.34.1