mirror of
https://github.com/apache/superset.git
synced 2026-04-20 08:34:37 +00:00
feat: catch errors on do_ping (#14250)
This commit is contained in:
@@ -73,7 +73,11 @@ class TestConnectionDatabaseCommand(BaseCommand):
|
||||
username = self._actor.username if self._actor is not None else None
|
||||
engine = database.get_sqla_engine(user_name=username)
|
||||
with closing(engine.raw_connection()) as conn:
|
||||
if not engine.dialect.do_ping(conn):
|
||||
try:
|
||||
alive = engine.dialect.do_ping(conn)
|
||||
except Exception: # pylint: disable=broad-except
|
||||
alive = False
|
||||
if not alive:
|
||||
raise DBAPIError(None, None, None)
|
||||
|
||||
# Log succesful connection test with engine
|
||||
|
||||
Reference in New Issue
Block a user