diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2014-07-03 21:49:10 -0400 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2014-07-03 21:49:37 -0400 |
commit | c60eb86a91eac57e556c07ee2a34870c065a9830 (patch) | |
tree | b43730bb9a2e793d88063fdbb5cb8c86eb863491 /lib/sqlalchemy/engine/interfaces.py | |
parent | e0a9b94abb92c6b62d6a6f70dec680d7ca35eed6 (diff) | |
download | sqlalchemy-c60eb86a91eac57e556c07ee2a34870c065a9830.tar.gz |
- Added new attributes :attr:`.ExecutionContext.exception` and
:attr:`.ExecutionContext.is_disconnect` which are meaningful within
the :meth:`.ConnectionEvents.dbapi_error` handler to see both the
original DBAPI error as well as whether or not it represents
a disconnect.
Diffstat (limited to 'lib/sqlalchemy/engine/interfaces.py')
-rw-r--r-- | lib/sqlalchemy/engine/interfaces.py | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/lib/sqlalchemy/engine/interfaces.py b/lib/sqlalchemy/engine/interfaces.py index 22801c284..230d00fc0 100644 --- a/lib/sqlalchemy/engine/interfaces.py +++ b/lib/sqlalchemy/engine/interfaces.py @@ -707,6 +707,41 @@ class ExecutionContext(object): and updates. """ + exception = None + """A DBAPI-level exception that was caught when this ExecutionContext + attempted to execute a statement. + + This attribute is meaningful only within the + :meth:`.ConnectionEvents.dbapi_error` event. + + .. versionadded:: 0.9.7 + + .. seealso:: + + :attr:`.ExecutionContext.is_disconnect` + + :meth:`.ConnectionEvents.dbapi_error` + + """ + + is_disconnect = None + """Boolean flag set to True or False when a DBAPI-level exception + is caught when this ExecutionContext attempted to execute a statement. + + This attribute is meaningful only within the + :meth:`.ConnectionEvents.dbapi_error` event. + + .. versionadded:: 0.9.7 + + .. seealso:: + + :attr:`.ExecutionContext.exception` + + :meth:`.ConnectionEvents.dbapi_error` + + """ + + def create_cursor(self): """Return a new cursor generated from this ExecutionContext's connection. |