You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by aa...@apache.org on 2022/08/29 21:06:33 UTC

[superset] 01/01: dataset exists error

This is an automated email from the ASF dual-hosted git repository.

aafghahi pushed a commit to branch arash.afghahi/sc-56047/chart-power-query-no-error-msg-if-save-new
in repository https://gitbox.apache.org/repos/asf/superset.git

commit 1961582a89c4d6561e7fe0f04e55fd36f28e0bee
Author: AAfghahi <ar...@gmail.com>
AuthorDate: Mon Aug 29 17:05:28 2022 -0400

    dataset exists error
---
 superset-frontend/src/SqlLab/actions/sqlLab.js                     | 5 ++++-
 superset-frontend/src/SqlLab/components/SaveDatasetModal/index.tsx | 2 ++
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/superset-frontend/src/SqlLab/actions/sqlLab.js b/superset-frontend/src/SqlLab/actions/sqlLab.js
index bac563436a..cb6f3c4095 100644
--- a/superset-frontend/src/SqlLab/actions/sqlLab.js
+++ b/superset-frontend/src/SqlLab/actions/sqlLab.js
@@ -1425,7 +1425,10 @@ export function createDatasource(vizOptions) {
 
         return Promise.resolve(json);
       })
-      .catch(() => {
+      .catch(error => {
+        getClientErrorObject(error).then(e => {
+          dispatch(addDangerToast(e.error));
+        });
         dispatch(
           createDatasourceFailed(
             t('An error occurred while creating the data source'),
diff --git a/superset-frontend/src/SqlLab/components/SaveDatasetModal/index.tsx b/superset-frontend/src/SqlLab/components/SaveDatasetModal/index.tsx
index 6d6acf8af9..bd267d1a24 100644
--- a/superset-frontend/src/SqlLab/components/SaveDatasetModal/index.tsx
+++ b/superset-frontend/src/SqlLab/components/SaveDatasetModal/index.tsx
@@ -307,9 +307,11 @@ export const SaveDatasetModal: FunctionComponent<SaveDatasetModalProps> = ({
       })
       .catch(() => {
         addDangerToast(t('An error occurred saving dataset'));
+        onHide();
       });
 
     setDatasetName(getDefaultDatasetName());
+    console.log(formData);
     onHide();
   };