mirror of
https://github.com/apache/superset.git
synced 2026-04-26 11:34:27 +00:00
feat(db): custom database error messages (#34674)
This commit is contained in:
@@ -189,7 +189,9 @@ class TestConnectionDatabaseCommand(BaseCommand):
|
||||
engine=database.db_engine_spec.__name__,
|
||||
)
|
||||
# check for custom errors (wrong username, wrong password, etc)
|
||||
errors = database.db_engine_spec.extract_errors(ex, self._context)
|
||||
errors = database.db_engine_spec.extract_errors(
|
||||
ex, self._context, database_name=database.unique_name
|
||||
)
|
||||
raise SupersetErrorsException(errors, status=400) from ex
|
||||
except OAuth2RedirectError:
|
||||
raise
|
||||
|
||||
@@ -124,7 +124,9 @@ class ValidateDatabaseParametersCommand(BaseCommand):
|
||||
"username": url.username,
|
||||
"database": url.database,
|
||||
}
|
||||
errors = database.db_engine_spec.extract_errors(ex, context)
|
||||
errors = database.db_engine_spec.extract_errors(
|
||||
ex, context, database_name=database.unique_name
|
||||
)
|
||||
raise DatabaseTestConnectionFailedError(errors, status=400) from ex
|
||||
|
||||
if not alive:
|
||||
|
||||
Reference in New Issue
Block a user