X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Fcharging-station%2FBootstrap.ts;h=27f4a6073c8c5159c1bfa2b134688e6d6027325a;hb=0557254bd178be09468f48b28c570efa4ada83b2;hp=76b2c2999d00318960199be014bfab9a49b60150;hpb=357a5553eba0104e7017b3d955a3ea6da0ef6a6d;p=e-mobility-charging-stations-simulator.git diff --git a/src/charging-station/Bootstrap.ts b/src/charging-station/Bootstrap.ts index 76b2c299..27f4a607 100644 --- a/src/charging-station/Bootstrap.ts +++ b/src/charging-station/Bootstrap.ts @@ -8,9 +8,9 @@ import { isMainThread } from 'node:worker_threads'; import chalk from 'chalk'; import { availableParallelism } from 'poolifier'; +import { waitChargingStationEvents } from './Helpers'; import type { AbstractUIServer } from './ui-server/AbstractUIServer'; import { UIServerFactory } from './ui-server/UIServerFactory'; -import { waitChargingStationEvents } from './Utils'; import { version } from '../../package.json' assert { type: 'json' }; import { BaseError } from '../exception'; import { type Storage, StorageFactory } from '../performance'; @@ -109,7 +109,7 @@ export class Bootstrap extends EventEmitter { public async start(): Promise { if (!isMainThread) { - throw new Error('Cannot start charging stations simulator from worker thread'); + throw new BaseError('Cannot start charging stations simulator from worker thread'); } if (this.started === false) { if (this.starting === false) { @@ -176,7 +176,7 @@ export class Bootstrap extends EventEmitter { public async stop(): Promise { if (!isMainThread) { - throw new Error('Cannot stop charging stations simulator from worker thread'); + throw new BaseError('Cannot stop charging stations simulator from worker thread'); } if (this.started === true) { if (this.stopping === false) {