From: Jérôme Benoit Date: Wed, 24 Aug 2022 20:36:24 +0000 (+0200) Subject: Fix exit conditions at startup X-Git-Tag: v1.1.66~6 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=e4cb2c14d14e95090cca15518594af1c3f369d2b;p=e-mobility-charging-stations-simulator.git Fix exit conditions at startup Signed-off-by: Jérôme Benoit --- diff --git a/src/charging-station/Bootstrap.ts b/src/charging-station/Bootstrap.ts index 2bc650cc..80e14d15 100644 --- a/src/charging-station/Bootstrap.ts +++ b/src/charging-station/Bootstrap.ts @@ -32,6 +32,9 @@ import UIServerFactory from './ui-server/UIServerFactory'; const moduleName = 'Bootstrap'; +const missingChargingStationsConfigurationExitCode = 1; +const noChargingStationTemplatesExitCode = 2; + export default class Bootstrap { private static instance: Bootstrap | null = null; private workerImplementation: WorkerAbstract | null = null; @@ -105,12 +108,13 @@ export default class Bootstrap { console.warn( chalk.yellow("'stationTemplateUrls' not defined or empty in configuration, exiting") ); + process.exit(missingChargingStationsConfigurationExitCode); } if (this.numberOfChargingStations === 0) { console.warn( chalk.yellow('No charging station template enabled in configuration, exiting') ); - process.exit(); + process.exit(noChargingStationTemplatesExitCode); } else { console.info( chalk.green(