X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Fcharging-station%2FBootstrap.ts;h=003b093a3579c02d094addc7f2210e88d14f789b;hb=6ccd865d6381ce21115dbe4c9271f64e5c8048c5;hp=88c516bddeb527be0c11cf03ac8902c3e16fda87;hpb=5b2721dbc4fa0b5ee6e48241a5077091a7b1c342;p=e-mobility-charging-stations-simulator.git diff --git a/src/charging-station/Bootstrap.ts b/src/charging-station/Bootstrap.ts index 88c516bd..003b093a 100644 --- a/src/charging-station/Bootstrap.ts +++ b/src/charging-station/Bootstrap.ts @@ -215,11 +215,11 @@ export class Bootstrap extends EventEmitter { return new Promise((resolve, reject) => { const waitTimeout = setTimeout(() => { const message = `Timeout ${formatDurationMilliSeconds( - Constants.STOP_SIMULATOR_TIMEOUT, + Constants.STOP_CHARGING_STATIONS_TIMEOUT, )} reached at stopping charging stations`; console.warn(chalk.yellow(message)); reject(new Error(message)); - }, Constants.STOP_SIMULATOR_TIMEOUT); + }, Constants.STOP_CHARGING_STATIONS_TIMEOUT); waitChargingStationEvents( this, ChargingStationWorkerMessageEvents.stopped, @@ -228,9 +228,7 @@ export class Bootstrap extends EventEmitter { .then(() => { resolve('Charging stations stopped'); }) - .catch((error) => { - reject(error); - }) + .catch(reject) .finally(() => { clearTimeout(waitTimeout); });