Opened 16 years ago
Closed 16 years ago
#13090 closed (fixed)
Incorrect handling of middleware exceptions
| Reported by: | Andrey Golovizin | Owned by: | Ivan Sagalaev |
|---|---|---|---|
| Component: | HTTP handling | Version: | dev |
| Severity: | Keywords: | ||
| Cc: | Andrey Golovizin | Triage Stage: | Unreviewed |
| Has patch: | yes | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | no |
| Easy pickings: | no | UI/UX: | no |
Description
Django won't display a 500 error page with DEBUG=False if an exception is raised from a middleware. The following traceback is returned instead:
Traceback (most recent call last):
File "/home/erosennin/workspace/ipi/django/trunk/django/core/servers/basehttp.py", line 280, in run
self.result = application(self.environ, self.start_response)
File "/home/erosennin/workspace/ipi/django/trunk/django/core/servers/basehttp.py", line 674, in __call__
return self.application(environ, start_response)
File "/home/erosennin/workspace/ipi/django/trunk/django/core/handlers/wsgi.py", line 241, in __call__
response = self.get_response(request)
File "/home/erosennin/workspace/ipi/django/trunk/django/core/handlers/base.py", line 143, in get_response
return self.handle_uncaught_exception(request, resolver, exc_info)
File "/home/erosennin/workspace/ipi/django/trunk/django/core/handlers/base.py", line 178, in handle_uncaught_exception
callback, param_dict = resolver.resolve500()
File "/home/erosennin/workspace/ipi/django/trunk/django/core/urlresolvers.py", line 268, in resolve500
return self._resolve_special('500')
File "/home/erosennin/workspace/ipi/django/trunk/django/core/urlresolvers.py", line 258, in _resolve_special
callback = getattr(self.urlconf_module, 'handler%s' % view_type)
AttributeError: 'NoneType' object has no attribute 'handler500'
This problem has been fixed in [12165], then reintroduced in [12186].
See also #6094.
Attachments (2)
Change History (6)
comment:1 by , 16 years ago
| Owner: | changed from to |
|---|
comment:2 by , 16 years ago
P.S. EroSennin, and the separate bug report with a traceback is indeed helpful.
comment:3 by , 16 years ago
| Has patch: | set |
|---|
Attached patch fixes the issue in what I believe a clean way. There's no test since the bug only occurs under DEBUG=False and AFAIK tests always run under DEBUG=True.
comment:4 by , 16 years ago
| Resolution: | → fixed |
|---|---|
| Status: | new → closed |
Note:
See TracTickets
for help on using tickets.
Huh... We've found the same bug just yesterday. I'll try to fix this tomorrow since both commits is my code.