diff --git a/superset/views/core.py b/superset/views/core.py index 28953406e1b7e..73b3e7aae15ff 100755 --- a/superset/views/core.py +++ b/superset/views/core.py @@ -702,7 +702,14 @@ def explore( # pylint: disable=too-many-locals,too-many-return-statements datasource_id, datasource_type = get_datasource_info( datasource_id, datasource_type, form_data ) - except SupersetException: + except SupersetException as ex: + flash( + _( + "Error occurred when opening the chart: %(error)s", + error=utils.error_msg_from_exception(ex), + ), + "danger", + ) return redirect(error_redirect) datasource = ConnectorRegistry.get_datasource( diff --git a/superset/views/utils.py b/superset/views/utils.py index 28104aa86a08a..0216026f264ac 100644 --- a/superset/views/utils.py +++ b/superset/views/utils.py @@ -220,7 +220,7 @@ def get_datasource_info( if not datasource_id: raise SupersetException( - "The datasource associated with this chart no longer exists" + "The dataset associated with this chart no longer exists" ) datasource_id = int(datasource_id) diff --git a/tests/core_tests.py b/tests/core_tests.py index 2363ab015a636..bcf5061cb87c7 100644 --- a/tests/core_tests.py +++ b/tests/core_tests.py @@ -863,7 +863,7 @@ def test_slice_payload_no_datasource(self): self.assertEqual( data["errors"][0]["message"], - "The datasource associated with this chart no longer exists", + "The dataset associated with this chart no longer exists", ) @pytest.mark.usefixtures("load_birth_names_dashboard_with_slices") diff --git a/tests/tasks/async_queries_tests.py b/tests/tasks/async_queries_tests.py index e44a51510e255..5a7b86a4d6297 100644 --- a/tests/tasks/async_queries_tests.py +++ b/tests/tasks/async_queries_tests.py @@ -124,5 +124,5 @@ def test_load_explore_json_into_cache_error(self, mock_update_job): with pytest.raises(SupersetException): load_explore_json_into_cache(job_metadata, form_data) - errors = ["The datasource associated with this chart no longer exists"] + errors = ["The dataset associated with this chart no longer exists"] mock_update_job.assert_called_with(job_metadata, "error", errors=errors)