Skip to content

Commit

Permalink
Fix dbapi error attribute
Browse files Browse the repository at this point in the history
  • Loading branch information
Simon-Chenzw authored Jul 4, 2024
1 parent b62512f commit 9d02586
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 19 deletions.
4 changes: 1 addition & 3 deletions clickhouse_sqlalchemy/drivers/asynch/connector.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,10 +114,8 @@ def __init__(self, asynch):
self.paramstyle = 'pyformat'
self._init_dbapi_attributes()

class Error(Exception):
pass

def _init_dbapi_attributes(self):
self.Error = self.asynch.errors.ClickHouseException
for name in (
'ServerException',
'UnexpectedPacketFromServerError',
Expand Down
9 changes: 1 addition & 8 deletions clickhouse_sqlalchemy/drivers/http/connector.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,7 @@
threadsafety = 2
# Python extended format codes, e.g. ...WHERE name=%(name)s
paramstyle = 'pyformat'


class Error(Exception):
"""
Exception that is the base class of all other error exceptions.
You can use this to catch all errors with one single except statement.
"""
pass
Error = Exception


def connect(*args, **kwargs):
Expand Down
9 changes: 1 addition & 8 deletions clickhouse_sqlalchemy/drivers/native/connector.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,7 @@
threadsafety = 2
# Python extended format codes, e.g. ...WHERE name=%(name)s
paramstyle = 'pyformat'


class Error(Exception):
"""
Exception that is the base class of all other error exceptions.
You can use this to catch all errors with one single except statement.
"""
pass
Error = DatabaseException


def connect(*args, **kwargs):
Expand Down

0 comments on commit 9d02586

Please sign in to comment.