fix(ui): handle vue.js app initialization error
[e-mobility-charging-stations-simulator.git] / ui / web / src / main.ts
index 25f92db011de67480df34a95dc48c33dec318b94..2071293947c869784d7f24f7df8b0a6f5afeb451 100644 (file)
@@ -45,11 +45,16 @@ fetch('/config.json')
     response
       .json()
       .then(config => {
-        initializeApp(config)
+        try {
+          initializeApp(config)
+        } catch (error) {
+          // TODO: add code for UI notifications or other error handling logic
+          console.error('Error at initializing the app:', error)
+        }
       })
       .catch(error => {
         // TODO: add code for UI notifications or other error handling logic
-        console.error('Error at app configuration JSON deserialization:', error)
+        console.error('Error at deserializing JSON app configuration:', error)
       })
   })
   .catch(error => {