Skip to content
This repository was archived by the owner on Mar 13, 2020. It is now read-only.

Commit 93f58e2

Browse files
authored
[OSC-1273] recognise additional errors that trigger a failure (#27)
1 parent fe92b34 commit 93f58e2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

rdl/data_sources/MsSqlDataSource.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,8 @@ def create_connection_with_failover(self):
7575
DATABASE={database}''')
7676
try:
7777
return pyodbc.connect(dsn, server=server)
78-
except (sqlalchemy.exc.OperationalError, pyodbc.OperationalError) as e:
79-
if e.args[0] == "08001" and failover is not None:
78+
except (sqlalchemy.exc.OperationalError, pyodbc.OperationalError, pyodbc.ProgrammingError) as e:
79+
if e.args[0] in ["08001", "HYT00", "42000"] and failover is not None:
8080
self.logger.warning(f'Using Failover Server: {failover}')
8181
return pyodbc.connect(dsn, server=failover)
8282
raise e

0 commit comments

Comments
 (0)