diff options
| author | James Aylett <james@tartarus.org> | 2013-06-04 12:31:06 +0100 |
|---|---|---|
| committer | James Aylett <james@tartarus.org> | 2013-06-04 12:46:10 +0100 |
| commit | 54485557855d58d9a5027511025d5ab22f721c6d (patch) | |
| tree | c7bf9489c027a33de70dbc9ed1a7744e733b70c0 /docs/ref/exceptions.txt | |
| parent | 4f4e9243e4cf585e32a882804084853108ef94c0 (diff) | |
Fixed #17601 -- expose underlying db exceptions under py2
Use __cause__ to expose the underlying database exceptions even
under python 2.
Diffstat (limited to 'docs/ref/exceptions.txt')
| -rw-r--r-- | docs/ref/exceptions.txt | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/docs/ref/exceptions.txt b/docs/ref/exceptions.txt index 6a5e6f49d5..b15bbea8fa 100644 --- a/docs/ref/exceptions.txt +++ b/docs/ref/exceptions.txt @@ -152,10 +152,16 @@ The Django wrappers for database exceptions behave exactly the same as the underlying database exceptions. See :pep:`249`, the Python Database API Specification v2.0, for further information. +As per :pep:`3134`, a ``__cause__`` attribute is set with the original +(underlying) database exception, allowing access to any additional +information provided. (Note that this attribute is available under +both Python 2 and Python 3, although :pep:`3134` normally only applies +to Python 3.) + .. versionchanged:: 1.6 Previous version of Django only wrapped ``DatabaseError`` and - ``IntegrityError``. + ``IntegrityError``, and did not provide ``__cause__``. .. exception:: models.ProtectedError |
