From: Jérôme Benoit Date: Mon, 17 Jul 2023 14:22:25 +0000 (+0200) Subject: refactor: move code into try catch block X-Git-Tag: v1.2.18~11 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=c96b764e304602bb2ceac55454fa460c066acdc5;p=e-mobility-charging-stations-simulator.git refactor: move code into try catch block Signed-off-by: Jérôme Benoit --- diff --git a/src/utils/Configuration.ts b/src/utils/Configuration.ts index 473906df..4aaa2250 100644 --- a/src/utils/Configuration.ts +++ b/src/utils/Configuration.ts @@ -474,6 +474,9 @@ export class Configuration { Configuration.configurationData = JSON.parse( readFileSync(Configuration.configurationFile, 'utf8'), ) as ConfigurationData; + if (!Configuration.configurationFileWatcher) { + Configuration.configurationFileWatcher = Configuration.getConfigurationFileWatcher(); + } } catch (error) { Configuration.handleFileException( Configuration.configurationFile, @@ -482,9 +485,6 @@ export class Configuration { Configuration.logPrefix(), ); } - if (!Configuration.configurationFileWatcher) { - Configuration.configurationFileWatcher = Configuration.getConfigurationFileWatcher(); - } } return Configuration.configurationData; }