From: Jérôme Benoit Date: Tue, 20 Feb 2024 13:37:34 +0000 (+0100) Subject: fix(ui): handle vue.js app initialization error X-Git-Tag: v1.2.38~71 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=bcb671db37d3f4f60d5ac300df8b686404e787ff;p=e-mobility-charging-stations-simulator.git fix(ui): handle vue.js app initialization error Signed-off-by: Jérôme Benoit --- diff --git a/ui/web/src/main.ts b/ui/web/src/main.ts index 25f92db0..20712939 100644 --- a/ui/web/src/main.ts +++ b/ui/web/src/main.ts @@ -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 => {