Django should wrap all PEP 249 exceptions in db.utils
|Reported by:||Xia Kai(夏恺)||Owned by:||Aymeric Augustin|
|Component:||Database layer (models, ORM)||Version:||1.3|
|Cc:||xiaket@…, jonas-django@…, James Henstridge, gcbirzan||Triage Stage:||Accepted|
|Has patch:||yes||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
There are only two Exceptions defined in db.utils, namely DatabaseError and IntegrityError. This does not conform with PEP 249, Python Database API Specification v2.0. IMHO, more exceptions should be added here. Moreover, db backends for python binding of various databases conforming with PEP 249 should be changed to reflect this change.
Sorry that I cannot provide a full patch for this ticket, for I'm not familiar with all db backends.
This change would give more flexibility in db exception handling.
Change History (31)
comment:2 follow-up: 3 Changed 6 years ago by
|Summary:||Exceptions defined in db.utils should conform with PEP 249 → Django should wrap all PEP 249 exceptions in db.utils|
|Triage Stage:||Unreviewed → Accepted|
comment:27 Changed 4 years ago by
|Owner:||changed from nobody to Aymeric Augustin|
|Status:||new → assigned|