From 172b50b72224dea985cd665accab2ff3110f6674 Mon Sep 17 00:00:00 2001 From: Marti Raudsepp Date: Tue, 23 Apr 2013 21:17:04 +0300 Subject: [PATCH] Clearer explanation when exception has no message "No exception supplied" is misleading; actually there is an exception, but there's no message string. --- django/views/debug.py | 4 ++-- tests/view_tests/tests/test_debug.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/django/views/debug.py b/django/views/debug.py index 9b95b524d2b..3a840588e35 100644 --- a/django/views/debug.py +++ b/django/views/debug.py @@ -584,7 +584,7 @@ TECHNICAL_500_TEMPLATE = """

{% if exception_type %}{{ exception_type }}{% else %}Report{% endif %}{% if request %} at {{ request.path_info|escape }}{% endif %}

-
{% if exception_value %}{{ exception_value|force_escape }}{% else %}No exception supplied{% endif %}
+
{% if exception_value %}{{ exception_value|force_escape }}{% else %}No exception message supplied{% endif %}
{% if request %} @@ -927,7 +927,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 %} diff --git a/tests/view_tests/tests/test_debug.py b/tests/view_tests/tests/test_debug.py index b44cd88abed..dd0d0dc9a1f 100644 --- a/tests/view_tests/tests/test_debug.py +++ b/tests/view_tests/tests/test_debug.py @@ -128,7 +128,7 @@ class ExceptionReporterTests(TestCase): reporter = ExceptionReporter(request, None, None, None) html = reporter.get_traceback_html() self.assertIn('

Report at /test_view/

', html) - self.assertIn('
No exception supplied
', html) + self.assertIn('
No exception message supplied
', html) self.assertIn('', html) self.assertIn('', html) self.assertNotIn('', html)
Request Method:Request URL:Exception Type: