From 50f9663622091d01a43d013d44424738b279d3f3 Mon Sep 17 00:00:00 2001 From: Martin McKeaveney Date: Tue, 23 Feb 2021 10:41:11 +0000 Subject: [PATCH] ensure error is thrown on client validation failure --- packages/builder/src/builderStore/store/backend.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/builder/src/builderStore/store/backend.js b/packages/builder/src/builderStore/store/backend.js index 6731aea51c..0a5b9f0461 100644 --- a/packages/builder/src/builderStore/store/backend.js +++ b/packages/builder/src/builderStore/store/backend.js @@ -135,6 +135,9 @@ export const getBackendUiStore = () => { } query.datasourceId = datasourceId const response = await api.post(`/api/queries`, query) + if (response.status !== 200) { + throw new Error("Failed saving query.") + } const json = await response.json() store.update(state => { const currentIdx = state.queries.findIndex(