From 08f48e2f7ed2fcd8f278deba6c4a4c6f052fd2f3 Mon Sep 17 00:00:00 2001 From: Silver Date: Thu, 7 Aug 2025 14:48:21 +0200 Subject: [PATCH 01/13] catch 404 when loading context, table, view Signed-off-by: Silver --- src/store/store.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/store/store.js b/src/store/store.js index 04b62c0e1c..5376fdd18e 100644 --- a/src/store/store.js +++ b/src/store/store.js @@ -470,8 +470,12 @@ export const useTablesStore = defineStore('store', { const res = await axios.get(generateOcsUrl('/apps/tables/api/2/contexts/' + id)) this.setContext(res.data.ocs.data) } catch (e) { + if (e?.response?.status === 404) { + throw new Error('NOT_FOUND') + } displayError(e, t('tables', 'Could not load application.')) showError(t('tables', 'Could not fetch application')) + throw e } return true }, @@ -501,8 +505,12 @@ export const useTablesStore = defineStore('store', { tables.push(res.data.ocs.data) this.setTables([...tables]) } catch (e) { + if (e?.response?.status === 404) { + throw new Error('NOT_FOUND') + } displayError(e, t('tables', 'Could not load table.')) showError(t('tables', 'Could not fetch table')) + throw e } return res?.data.ocs.data }, @@ -519,8 +527,12 @@ export const useTablesStore = defineStore('store', { views.push(res.data) this.setViews([...views]) } catch (e) { + if (e?.response?.status === 404) { + throw new Error('NOT_FOUND') + } displayError(e, t('tables', 'Could not load view')) showError(t('tables', 'Could not fetch view')) + throw e } return res?.data }, From 338279b0ade210f6b924eb42657345a92e205e6a Mon Sep 17 00:00:00 2001 From: Silver Date: Thu, 7 Aug 2025 14:49:43 +0200 Subject: [PATCH 02/13] show error messages in ui for nonexistent context, table, view Signed-off-by: Silver --- src/pages/Context.vue | 120 +++++++++++++++++++++++++++++------------- src/pages/Table.vue | 85 +++++++++++++++++++++++++----- src/pages/View.vue | 79 ++++++++++++++++++++++++--- 3 files changed, 228 insertions(+), 56 deletions(-) diff --git a/src/pages/Context.vue b/src/pages/Context.vue index 6bc84a53d9..ee995a378a 100644 --- a/src/pages/Context.vue +++ b/src/pages/Context.vue @@ -5,7 +5,13 @@