> First exception is caught by:
https://github.com/django/django/blob/master/django/core/handlers/bas...
> session.save() bug is later caught by:
https://github.com/django/django/blob/master/django/core/handlers/bas...
>
> So, am I way off base with this? Is it worth opening a separate ticket?
I have updated the branch [
https://github.com/akaariai/django/tree/
ticket_3881], I think it now has all the necessary doc changes. If
somebody is kind enough to double-check the patch, that would be
great. If that somebody is a committer, committing the code at the
same time is fine for me. If no further feedback, I will commit the
patch in a day or two.
As for showing the original exception if a middleware generates an
exception, something along those lines sounds good. However, hiding
the middleware exception can be as bad as hiding the original
exception. So, maybe there should be a message telling that there was
an exception in the view, and then an exception in the middleware,
too. The latest (that is, the middleware's exception) should be shown
in full, as that is the first thing that should be debugged. There is
no way to get the middleware exception's traceback if that is not the
default, but one can get the original exception by just disabling the
problematic middleware.
- Anssi