#15901: Django should wrap all PEP 249 exceptions in db.utils
-------------------------------------+-------------------------------------
     Reporter:  xiaket               |                    Owner:  nobody
         Type:  New feature          |                   Status:  new
    Component:  Database layer       |                  Version:  1.3
  (models, ORM)                      |               Resolution:
     Severity:  Normal               |             Triage Stage:  Accepted
     Keywords:                       |      Needs documentation:  0
    Has patch:  0                    |  Patch needs improvement:  0
  Needs tests:  0                    |                    UI/UX:  0
Easy pickings:  0                    |
-------------------------------------+-------------------------------------
Changes (by jamesh):

 * cc: jamesh (added)


Comment:

 I filed #16948, and have put together a patch attached to that bug that
 might satisfy the needs for this bug too.  I'd appreciate some testing if
 possible.

 It doesn't add new Django backend independent exceptions, but instead
 patches `django.db.utils.DatabaseError` and `IntegrityError` into the
 adapter's exception hierarchy.  This way we can pass the adapter's
 exceptions through unmodified while still allowing code to catch the
 backend independent exceptions.

 I suspect that if any application code cares about exceptions more
 specific than `DatabaseError` and `IntegrityError` that it has
 dependencies on a particular backend, so why not use the adapter's
 exceptions directly?

-- 
Ticket URL: <https://code.djangoproject.com/ticket/15901#comment:8>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.

Reply via email to