diff options
| author | Jerrod Martin <jerrod@jerrod.me> | 2019-07-25 21:44:27 -0400 |
|---|---|---|
| committer | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2019-07-29 11:09:54 +0200 |
| commit | c7bef16a749ccbe2dbc8ce6b697dc80146584384 (patch) | |
| tree | d0b0916486a62cb89cd4d78d9014e39002ae486f /django/views/templates | |
| parent | 68aeb9016084290aac4f82860e17a9f4e941676e (diff) | |
Fixed #30411 -- Improved formatting of text tracebacks in technical 500 templates.
Co-Authored-By: Daniel Hahler <git@thequod.de>
Diffstat (limited to 'django/views/templates')
| -rw-r--r-- | django/views/templates/technical_500.html | 7 | ||||
| -rw-r--r-- | django/views/templates/technical_500.txt | 7 |
2 files changed, 6 insertions, 8 deletions
diff --git a/django/views/templates/technical_500.html b/django/views/templates/technical_500.html index b03e1ada8c..6a8ea005b2 100644 --- a/django/views/templates/technical_500.html +++ b/django/views/templates/technical_500.html @@ -313,14 +313,13 @@ In template {{ template_info.name }}, error at line {{ template_info.line }} {{ template_info.message }} {% for source_line in template_info.source_lines %}{% if source_line.0 == template_info.line %} {{ source_line.0 }} : {{ template_info.before }} {{ template_info.during }} {{ template_info.after }}{% else %} {{ source_line.0 }} : {{ source_line.1 }}{% endif %}{% endfor %}{% endif %} -Traceback:{% for frame in frames %} +Traceback (most recent call last):{% for frame in frames %} {% ifchanged frame.exc_cause %}{% if frame.exc_cause %}{% if frame.exc_cause_explicit %} The above exception ({{ frame.exc_cause|force_escape }}) was the direct cause of the following exception: {% else %} During handling of the above exception ({{ frame.exc_cause|force_escape }}), another exception occurred: -{% endif %}{% endif %}{% endifchanged %} -File "{{ frame.filename }}" in {{ frame.function }} -{% if frame.context_line %} {{ frame.lineno }}. {{ frame.context_line }}{% endif %}{% endfor %} +{% endif %}{% endif %}{% endifchanged %} File "{{ frame.filename }}"{% if frame.context_line %}, line {{ frame.lineno }}{% endif %}, in {{ frame.function }} +{% if frame.context_line %} {% spaceless %}{{ frame.context_line }}{% endspaceless %}{% endif %}{% endfor %} Exception Type: {{ exception_type }}{% if request %} at {{ request.path_info }}{% endif %} Exception Value: {{ exception_value|force_escape }} diff --git a/django/views/templates/technical_500.txt b/django/views/templates/technical_500.txt index 1777051906..c9f70af797 100644 --- a/django/views/templates/technical_500.txt +++ b/django/views/templates/technical_500.txt @@ -27,12 +27,11 @@ In template {{ template_info.name }}, error at line {{ template_info.line }} {{ template_info.message }} {% for source_line in template_info.source_lines %}{% if source_line.0 == template_info.line %} {{ source_line.0 }} : {{ template_info.before }} {{ template_info.during }} {{ template_info.after }}{% else %} {{ source_line.0 }} : {{ source_line.1 }}{% endif %}{% endfor %}{% endif %}{% if frames %} -Traceback: +Traceback (most recent call last): {% for frame in frames %}{% ifchanged frame.exc_cause %}{% if frame.exc_cause %} {% if frame.exc_cause_explicit %}The above exception ({{ frame.exc_cause }}) was the direct cause of the following exception:{% else %}During handling of the above exception ({{ frame.exc_cause }}), another exception occurred:{% endif %} -{% endif %}{% endifchanged %} -File "{{ frame.filename }}" in {{ frame.function }} -{% if frame.context_line %} {{ frame.lineno }}. {{ frame.context_line }}{% endif %} +{% endif %}{% endifchanged %} File "{{ frame.filename }}"{% if frame.context_line %}, line {{ frame.lineno }}{% endif %}, in {{ frame.function }} +{% if frame.context_line %} {% spaceless %}{{ frame.context_line }}{% endspaceless %}{% endif %} {% endfor %} {% if exception_type %}Exception Type: {{ exception_type }}{% if request %} at {{ request.path_info }}{% endif %} {% if exception_value %}Exception Value: {{ exception_value }}{% endif %}{% endif %}{% endif %} |
