mirror of
https://github.com/apache/superset.git
synced 2026-04-19 08:04:53 +00:00
feat(bigquery): Custom message when Service Account doesnt have the correct Roles and Permissions (#21838)
This commit is contained in:
committed by
GitHub
parent
059e53a39f
commit
203b289021
@@ -31,6 +31,7 @@ from superset.databases.commands.exceptions import (
|
||||
)
|
||||
from superset.databases.commands.test_connection import TestConnectionDatabaseCommand
|
||||
from superset.databases.dao import DatabaseDAO
|
||||
from superset.exceptions import SupersetErrorsException
|
||||
from superset.extensions import db, event_logger, security_manager
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
@@ -46,6 +47,13 @@ class CreateDatabaseCommand(BaseCommand):
|
||||
try:
|
||||
# Test connection before starting create transaction
|
||||
TestConnectionDatabaseCommand(self._properties).run()
|
||||
except SupersetErrorsException as ex:
|
||||
event_logger.log_with_context(
|
||||
action=f"db_creation_failed.{ex.__class__.__name__}",
|
||||
engine=self._properties.get("sqlalchemy_uri", "").split(":")[0],
|
||||
)
|
||||
# So we can show the original message
|
||||
raise ex
|
||||
except Exception as ex:
|
||||
event_logger.log_with_context(
|
||||
action=f"db_creation_failed.{ex.__class__.__name__}",
|
||||
|
||||
Reference in New Issue
Block a user