refactor: move code into try catch block
authorJérôme Benoit <jerome.benoit@sap.com>
Mon, 17 Jul 2023 14:22:25 +0000 (16:22 +0200)
committerJérôme Benoit <jerome.benoit@sap.com>
Mon, 17 Jul 2023 14:22:25 +0000 (16:22 +0200)
Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>
src/utils/Configuration.ts

index 473906dff14f8c94d50fdb277d61992c78692ec0..4aaa2250dc77169cf0113b0958ce23738680da26 100644 (file)
@@ -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;
   }