diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2015-05-15 12:35:21 -0400 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2015-05-15 12:38:28 -0400 |
commit | d178707ecaeb547470e2b7b37b9a939abc69cbd0 (patch) | |
tree | dc4b674748cf673a123b90797c3525c3a13ef657 /lib/sqlalchemy/engine/base.py | |
parent | 64c1f2e5688879e1cc087f4e4a893d32267fd1fb (diff) | |
download | sqlalchemy-d178707ecaeb547470e2b7b37b9a939abc69cbd0.tar.gz |
- Added support for the case of the misbehaving DBAPI that has
pep-249 exception names linked to exception classes of an entirely
different name, preventing SQLAlchemy's own exception wrapping from
wrapping the error appropriately.
The SQLAlchemy dialect in use needs to implement a new
accessor :attr:`.DefaultDialect.dbapi_exception_translation_map`
to support this feature; this is implemented now for the py-postgresql
dialect.
fixes #3421
Diffstat (limited to 'lib/sqlalchemy/engine/base.py')
-rw-r--r-- | lib/sqlalchemy/engine/base.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/sqlalchemy/engine/base.py b/lib/sqlalchemy/engine/base.py index af310c450..7ebe39bbf 100644 --- a/lib/sqlalchemy/engine/base.py +++ b/lib/sqlalchemy/engine/base.py @@ -1261,7 +1261,8 @@ class Connection(Connectable): exc.DBAPIError.instance(statement, parameters, e, - self.dialect.dbapi.Error), + self.dialect.dbapi.Error, + dialect=self.dialect), exc_info ) self._reentrant_error = True @@ -1277,7 +1278,8 @@ class Connection(Connectable): parameters, e, self.dialect.dbapi.Error, - connection_invalidated=self._is_disconnect) + connection_invalidated=self._is_disconnect, + dialect=self.dialect) else: sqlalchemy_exception = None |