#16674: Django's WSGI Handler should report exceptions to the start_response()
callback
-----------------------------------------+------------------------------
Reporter: jamesh | Owner: nobody
Type: Uncategorized | Status: new
Milestone: | Component: Core (Other)
Version: SVN | Severity: Normal
Resolution: | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-----------------------------------------+------------------------------
Comment (by grahamd):
Doing that would then cause the exception to propagate all the way up and
you would loose the default Django error page and at worst get a generic
web server/WSGI server error page. That one place isn't sufficient anyway
if your intent is to catch details of any errors. This is because that
function is only called when there is no error response middleware to
render a custom error page. You would therefore miss those errors when a
error response middleware generated an error page. Finally, that function
also possibly isn't called when there is an error with view handler lookup
by the URL resolver.
The solution therefore isn't to try and propagate stuff up to
start_response(), but for Django to provide a callback/event mechanism for
being notified of exceptions in the various contexts they can occur prior
to being consumed within the Django framework and an error page of some
sort generated. That way you could register a callback to be notified of
such things.
Agree though from own experience in having to do it, that it is currently
a pain to monkey match all the places required to capture errors and
notification mechanism would be nice.
--
Ticket URL: <https://code.djangoproject.com/ticket/16674#comment:2>
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.