X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Fcharging-station%2FChargingStationWorker.ts;h=7c7a523558bd6e9b547afe8775ec71c79f11187b;hb=bf84730b23a5bc079f7dbfda792b660af6fd146b;hp=ff9dbe6286dab402ec6531ca03d05e4792e538e3;hpb=769d3b106c5e4744487bc633da4e4ee93f8f1bf4;p=e-mobility-charging-stations-simulator.git diff --git a/src/charging-station/ChargingStationWorker.ts b/src/charging-station/ChargingStationWorker.ts index ff9dbe62..7c7a5235 100644 --- a/src/charging-station/ChargingStationWorker.ts +++ b/src/charging-station/ChargingStationWorker.ts @@ -6,6 +6,7 @@ import { parentPort } from 'node:worker_threads'; import { ThreadWorker } from 'poolifier'; import { ChargingStation } from './ChargingStation'; +import { BaseError } from '../exception'; import type { ChargingStationWorkerData } from '../types'; import { Configuration } from '../utils'; import { POOL_MAX_INACTIVE_TIME, type WorkerMessage, WorkerMessageEvents } from '../worker'; @@ -48,7 +49,7 @@ class ChargingStationWorker extends AsyncResource { } break; default: - throw new Error( + throw new BaseError( `Unknown worker event: '${message.event}' received with data: '${JSON.stringify( message.data, null,