Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixed super-edge-case bug in debug view where exc_value.args was empt…

…y. I managed to trigger this in some template code

git-svn-id: http://code.djangoproject.com/svn/django/trunk@17245 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 98c974c70b4065e649a1d1f0b21062d48bec4bdb 1 parent 2875657
@adrianholovaty adrianholovaty authored
Showing with 7 additions and 1 deletion.
  1. +7 −1 django/views/debug.py
View
8 django/views/debug.py
@@ -302,8 +302,14 @@ def get_template_exception_info(self):
top = max(1, line - context_lines)
bottom = min(total, line + 1 + context_lines)
+ # In some rare cases, exc_value.args might be empty.
+ try:
+ message = self.exc_value.args[0]
+ except IndexError:
+ message = '(Could not get exception message)'
+
self.template_info = {
- 'message': self.exc_value.args[0],
+ 'message': message,
'source_lines': source_lines[top:bottom],
'before': before,
'during': during,
Please sign in to comment.
Something went wrong with that request. Please try again.