Skip to content

Commit

Permalink
Merge pull request #1027 from intgr/debug_no_exc_message
Browse files Browse the repository at this point in the history
Clearer explanation when exception has no message
  • Loading branch information
timgraham committed May 30, 2013
2 parents 5074c75 + 172b50b commit 7902fd7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions django/views/debug.py
Expand Up @@ -595,7 +595,7 @@ def default_urlconf(request):
<body> <body>
<div id="summary"> <div id="summary">
<h1>{% if exception_type %}{{ exception_type }}{% else %}Report{% endif %}{% if request %} at {{ request.path_info|escape }}{% endif %}</h1> <h1>{% if exception_type %}{{ exception_type }}{% else %}Report{% endif %}{% if request %} at {{ request.path_info|escape }}{% endif %}</h1>
<pre class="exception_value">{% if exception_value %}{{ exception_value|force_escape }}{% else %}No exception supplied{% endif %}</pre> <pre class="exception_value">{% if exception_value %}{{ exception_value|force_escape }}{% else %}No exception message supplied{% endif %}</pre>
<table class="meta"> <table class="meta">
{% if request %} {% if request %}
<tr> <tr>
Expand Down Expand Up @@ -940,7 +940,7 @@ def default_urlconf(request):
""" """


TECHNICAL_500_TEXT_TEMPLATE = """{% load firstof from future %}{% firstof exception_type 'Report' %}{% if request %} at {{ request.path_info }}{% endif %} TECHNICAL_500_TEXT_TEMPLATE = """{% load firstof from future %}{% firstof exception_type 'Report' %}{% if request %} at {{ request.path_info }}{% endif %}
{% firstof exception_value 'No exception supplied' %} {% firstof exception_value 'No exception message supplied' %}
{% if request %} {% if request %}
Request Method: {{ request.META.REQUEST_METHOD }} Request Method: {{ request.META.REQUEST_METHOD }}
Request URL: {{ request.build_absolute_uri }}{% endif %} Request URL: {{ request.build_absolute_uri }}{% endif %}
Expand Down
2 changes: 1 addition & 1 deletion tests/view_tests/tests/test_debug.py
Expand Up @@ -178,7 +178,7 @@ def test_no_exception(self):
reporter = ExceptionReporter(request, None, None, None) reporter = ExceptionReporter(request, None, None, None)
html = reporter.get_traceback_html() html = reporter.get_traceback_html()
self.assertIn('<h1>Report at /test_view/</h1>', html) self.assertIn('<h1>Report at /test_view/</h1>', html)
self.assertIn('<pre class="exception_value">No exception supplied</pre>', html) self.assertIn('<pre class="exception_value">No exception message supplied</pre>', html)
self.assertIn('<th>Request Method:</th>', html) self.assertIn('<th>Request Method:</th>', html)
self.assertIn('<th>Request URL:</th>', html) self.assertIn('<th>Request URL:</th>', html)
self.assertNotIn('<th>Exception Type:</th>', html) self.assertNotIn('<th>Exception Type:</th>', html)
Expand Down

0 comments on commit 7902fd7

Please sign in to comment.