summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/engine
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2013-12-07 17:20:05 -0500
committerMike Bayer <mike_mp@zzzcomputing.com>2013-12-07 17:24:11 -0500
commitb113202eecd7360bf41ecc8eeca1dd120cc30567 (patch)
treec7a08aa0bebd10ab8c5a7241ca162d3f0ddb194d /lib/sqlalchemy/engine
parent71a9947410a3c32be48a3461e1a90a593c4406cd (diff)
downloadsqlalchemy-b113202eecd7360bf41ecc8eeca1dd120cc30567.tar.gz
- A DBAPI that raises an error on ``connect()`` which is not a subclass
of dbapi.Error (such as ``TypeError``, ``NotImplementedError``, etc.) will propagate the exception unchanged. Previously, the error handling specific to the ``connect()`` routine would both inappropriately run the exception through the dialect's :meth:`.Dialect.is_disconnect` routine as well as wrap it in a :class:`sqlalchemy.exc.DBAPIError`. It is now propagated unchanged in the same way as occurs within the execute process. [ticket:2881] - add tests for this in test_parseconnect, but also add tests in test_execute to ensure the execute() behavior as well
Diffstat (limited to 'lib/sqlalchemy/engine')
-rw-r--r--lib/sqlalchemy/engine/strategies.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/sqlalchemy/engine/strategies.py b/lib/sqlalchemy/engine/strategies.py
index 8f30f1a2c..ec10950b2 100644
--- a/lib/sqlalchemy/engine/strategies.py
+++ b/lib/sqlalchemy/engine/strategies.py
@@ -78,7 +78,7 @@ class DefaultEngineStrategy(EngineStrategy):
def connect():
try:
return dialect.connect(*cargs, **cparams)
- except Exception, e:
+ except dialect.dbapi.Error, e:
invalidated = dialect.is_disconnect(e, None, None)
# Py3K
#raise exc.DBAPIError.instance(None, None,