#12594: Meaningless exception when DEBUG=False and resolver.urlconf_module is
None.
---------------------------+------------------------------------------------
Reporter: buriy | Owner: nobody
Status: new | Milestone: 1.2
Component: HTTP handling | Version: 1.2-alpha
Keywords: | Stage: Unreviewed
Has_patch: 1 |
---------------------------+------------------------------------------------
Because of resolver.resolve500() can now fail due to urlconf_module set to
None in django/core/handlers/base.py,
sometimes site developer doesn't get appropriate error message.
Instead developer gets message that handler500 is not found in urlconf
module.
Problem is only in handler500 lookup, everything else goes well.
How to reproduce:
set DEBUG to False, comment out ROOT_URLCONF line.
I managed to find this problem it another way, but it will take some time
to figure out how settings.py can be imported without errors, but get
empty dir to LazySettings.
My suggested fix:
{{{
#!python
def handle_uncaught_exception(self, request, resolver, exc_info):
...
mail_admins(subject, message, fail_silently=True)
# Return an HttpResponse that displays a friendly error message.
if resolver.urlconf_module is None: # FIX LINE1: you aren't
getting http500!
raise exc_info[1], None, exc_info[2] # FIX LINE2: so we'll
raise it raw.
callback, param_dict = resolver.resolve500()
return callback(request, **param_dict)
}}}
--
Ticket URL: <http://code.djangoproject.com/ticket/12594>
Django <http://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 django-upda...@googlegroups.com.
To unsubscribe from this group, send email to
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/django-updates?hl=en.