Made ModPythonHandler.get_response() tolerant of repr(request) that has an exception

git-svn-id: http://code.djangoproject.com/svn/django/trunk@232 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Adrian Holovaty 2005-07-20 00:47:10 +00:00
parent 49fbe711cc
commit 20820f2e85
1 changed files with 5 additions and 1 deletions

View File

@ -235,7 +235,11 @@ class ModPythonHandler:
return self.get_technical_error_response()
else:
subject = 'Coding error (%s IP)' % (request.META['REMOTE_ADDR'] in INTERNAL_IPS and 'internal' or 'EXTERNAL')
message = "%s\n\n%s" % (self._get_traceback(), request)
try:
request_repr = repr(request)
except:
request_repr = "Request repr() unavailable"
message = "%s\n\n%s" % (self._get_traceback(), request_repr)
mail_admins(subject, message, fail_silently=True)
return self.get_friendly_error_response(request, conf_module)