From 915a5dfd38ef21e7beb0a971ec9957cc4e8c45a8 Mon Sep 17 00:00:00 2001 From: Alicia Sykes Date: Sun, 21 Apr 2024 22:30:11 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=A5=85=20Also=20catch=20error=20for=20sub?= =?UTF-8?q?-pages?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/store.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/store.js b/src/store.js index a17c38aa..57710c0d 100644 --- a/src/store.js +++ b/src/store.js @@ -335,6 +335,7 @@ const store = new Vuex.Store({ data = yaml.load(response.data); } catch (parseError) { commit(CRITICAL_ERROR_MSG, `Failed to parse YAML: ${parseError.message}`); + return {}; } // Replace missing root properties with empty objects if (!data.appConfig) data.appConfig = {}; @@ -417,14 +418,14 @@ const store = new Vuex.Store({ commit(SET_IS_USING_LOCAL_CONFIG, true); } } catch (e) { - ErrorHandler('Malformed section data in local storage for sub-config'); + commit(CRITICAL_ERROR_MSG, 'Malformed section data in local storage for sub-config'); } } // Set the config commit(SET_CONFIG, configContent); commit(SET_CURRENT_CONFIG_INFO, { confPath: subConfigPath, confId: subConfigId }); }).catch((err) => { - ErrorHandler(`Unable to load config from '${subConfigPath}'`, err); + commit(CRITICAL_ERROR_MSG, `Unable to load config from '${subConfigPath}'`, err); }); } return null;