refactor(ui): add vue.js error handler
[e-mobility-charging-stations-simulator.git] / ui / web / src / main.ts
index 1b4d7ac607a6177f9aa8d20e1704493c5f86003d..ac9c9e8244df59b63bc7f60465b05270c16decb3 100644 (file)
@@ -8,6 +8,12 @@ const app = createApp(App)
 fetch('/config.json')
   .then(response => response.json())
   .then(config => {
+    app.config.errorHandler = (error, instance, info) => {
+      console.error('Error:', error)
+      console.info('Vue instance:', instance)
+      console.info('Error info:', info)
+      // TODO: Add code for UI notifications or other error handling logic
+    }
     app.config.globalProperties.$UIClient = UIClient.getInstance(config)
     app.use(router).mount('#app')
   })