Skip to content

Commit bbcd884

Browse files
authored
Fix dbapi error attribute
1 parent b62512f commit bbcd884

3 files changed

Lines changed: 3 additions & 19 deletions

File tree

clickhouse_sqlalchemy/drivers/asynch/connector.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,10 +114,8 @@ def __init__(self, asynch):
114114
self.paramstyle = 'pyformat'
115115
self._init_dbapi_attributes()
116116

117-
class Error(Exception):
118-
pass
119-
120117
def _init_dbapi_attributes(self):
118+
self.Error = self.asynch.errors.ClickHouseException
121119
for name in (
122120
'ServerException',
123121
'UnexpectedPacketFromServerError',

clickhouse_sqlalchemy/drivers/http/connector.py

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,7 @@
99
threadsafety = 2
1010
# Python extended format codes, e.g. ...WHERE name=%(name)s
1111
paramstyle = 'pyformat'
12-
13-
14-
class Error(Exception):
15-
"""
16-
Exception that is the base class of all other error exceptions.
17-
You can use this to catch all errors with one single except statement.
18-
"""
19-
pass
12+
Error = Exception
2013

2114

2215
def connect(*args, **kwargs):

clickhouse_sqlalchemy/drivers/native/connector.py

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,7 @@
1111
threadsafety = 2
1212
# Python extended format codes, e.g. ...WHERE name=%(name)s
1313
paramstyle = 'pyformat'
14-
15-
16-
class Error(Exception):
17-
"""
18-
Exception that is the base class of all other error exceptions.
19-
You can use this to catch all errors with one single except statement.
20-
"""
21-
pass
14+
Error = DatabaseException
2215

2316

2417
def connect(*args, **kwargs):

0 commit comments

Comments
 (0)