0
0
mirror of https://github.com/django/django.git synced 2024-12-01 15:42:04 +01:00

Merge pull request #1027 from intgr/debug_no_exc_message

Clearer explanation when exception has no message
This commit is contained in:
Tim Graham 2013-05-30 09:53:07 -07:00
commit 7902fd74f1
2 changed files with 3 additions and 3 deletions

View File

@ -595,7 +595,7 @@ TECHNICAL_500_TEMPLATE = """
<body>
<div id="summary">
<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">
{% if request %}
<tr>
@ -940,7 +940,7 @@ Exception Value: {{ exception_value|force_escape }}
"""
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 %}
Request Method: {{ request.META.REQUEST_METHOD }}
Request URL: {{ request.build_absolute_uri }}{% endif %}

View File

@ -178,7 +178,7 @@ class ExceptionReporterTests(TestCase):
reporter = ExceptionReporter(request, None, None, None)
html = reporter.get_traceback_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 URL:</th>', html)
self.assertNotIn('<th>Exception Type:</th>', html)