#16367: Exceptions thrown by middleware.process_response don't get to
middleware.process_exception
----------------------+-------------------------------
Reporter: bob84123 | Owner: nobody
Type: Bug | Status: new
Milestone: | Component: HTTP handling
Version: 1.3 | Severity: Normal
Keywords: | Triage Stage: Unreviewed
Has patch: 1 | Easy pickings: 0
UI/UX: 0 |
----------------------+-------------------------------
If I have a custom exception handler, implemented as a middleware class
with a process_exception method, this handler does not receive an
exception that is thrown during another middleware's process_response
method. This mainly happens with
django.middleware.transaction.TransactionMiddleware; if a view executes a
query that violates a PostgreSQL constraint, an exception isn't thrown
until the transaction is committed, which is inside the middleware, and so
my exception logger can't catch that.
I have a patch that fixes the issue and doesn't break anything else
(according to the test suite). I can't see any downsides of applying
this, but I may be missing something, so let me know.
--
Ticket URL: <https://code.djangoproject.com/ticket/16367>
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.