diff --git a/packages/builder/src/components/backend/DatasourceNavigator/TableIntegrationMenu/IntegrationConfigForm.svelte b/packages/builder/src/components/backend/DatasourceNavigator/TableIntegrationMenu/IntegrationConfigForm.svelte index 95b266e85b..211a6512a2 100644 --- a/packages/builder/src/components/backend/DatasourceNavigator/TableIntegrationMenu/IntegrationConfigForm.svelte +++ b/packages/builder/src/components/backend/DatasourceNavigator/TableIntegrationMenu/IntegrationConfigForm.svelte @@ -9,6 +9,7 @@ Modal, EnvDropdown, Accordion, + notifications, } from "@budibase/bbui" import KeyValueBuilder from "components/integration/KeyValueBuilder.svelte" import { capitalise } from "helpers" @@ -80,9 +81,13 @@ } async function save(data) { - await environment.createVariable(data) - config[selectedKey] = `{{ env.${data.name} }}` - createVariableModal.hide() + try { + await environment.createVariable(data) + config[selectedKey] = `{{ env.${data.name} }}` + createVariableModal.hide() + } catch (err) { + notifications.error(`Failed to create variable: ${err.message}`) + } } function showModal(configKey) { diff --git a/packages/builder/src/components/backend/DatasourceNavigator/TableIntegrationMenu/rest/auth/RestAuthenticationModal.svelte b/packages/builder/src/components/backend/DatasourceNavigator/TableIntegrationMenu/rest/auth/RestAuthenticationModal.svelte index 1f6979704f..80c5a18ade 100644 --- a/packages/builder/src/components/backend/DatasourceNavigator/TableIntegrationMenu/rest/auth/RestAuthenticationModal.svelte +++ b/packages/builder/src/components/backend/DatasourceNavigator/TableIntegrationMenu/rest/auth/RestAuthenticationModal.svelte @@ -8,6 +8,7 @@ Input, EnvDropdown, Modal, + notifications, } from "@budibase/bbui" import { AUTH_TYPE_LABELS, AUTH_TYPES } from "./authTypes" import BindableCombobox from "components/common/bindings/BindableCombobox.svelte" @@ -172,9 +173,13 @@ } const save = async data => { - await environment.createVariable(data) - form.basic[formFieldkey] = `{{ env.${data.name} }}` - createVariableModal.hide() + try { + await environment.createVariable(data) + form.basic[formFieldkey] = `{{ env.${data.name} }}` + createVariableModal.hide() + } catch (err) { + notifications.error(`Failed to create variable: ${err.message}`) + } } const onFieldChange = () => {