#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
 Keywords:                 |   Triage Stage:  Unreviewed
Has patch:  0              |  Easy pickings:  0
    UI/UX:  0              |
---------------------------+------------------------------
 The WSGI specification allows WSGI applications to pass an exception
 context to their start_response() callback if the response is being
 provided by an error handler.

 This is quite useful for WSGI middleware that collects data about errors:
 they can log the problem and then pass on the error page generated by the
 application.

 Unfortunately, Django's WSGI handler never seems to call start_response()
 with the third argument, preventing this sort of middleware from seeing
 errors in Django applications.

 I think a solution to this would be something like:
  1. override handle_uncaught_exception() in WSGIHandler and make it stash
 exc_info somewhere (on the response object would be hacky but maybe
 workable).
  2. after __call__ invokes get_response(), check for a captured exc_info
 value.
  3. if exc_info was captured, pass it to start_response()

-- 
Ticket URL: <https://code.djangoproject.com/ticket/16674>
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