#1458 closed defect (wontfix)
make the template error page useful for command line clients
Reported by: | Owned by: | Adrian Holovaty | |
---|---|---|---|
Component: | Core (Other) | Version: | |
Severity: | normal | Keywords: | |
Cc: | Triage Stage: | Ready for checkin | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | UI/UX: |
Description
when using curl, or a command line client (say a automated update bot) the error message is hard to understand (or even see)
my solution was to do the following
Index: debug.py =================================================================== --- debug.py (revision 2461) +++ debug.py (working copy) @@ -181,6 +181,17 @@ TECHNICAL_500_TEMPLATE = """ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html lang="en"> +<!-- +Traceback (most recent call last): +{% for frame in frames %} + File "{{ frame.filename }}" in {{ frame.function }} + {% if frame.context_line %} + {{ frame.lineno|add:"1" }}. {{ frame.context_line|escape }} + {% endif %} +{% endfor %} +{{ exception_type }} at {{ request.path }} +{{ exception_value|escape }} +--> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <meta name="robots" content="NONE,NOARCHIVE" /> @@ -531,7 +542,17 @@ display a standard 500 page. </p> </div> - +<!-- +Traceback (most recent call last): +{% for frame in frames %} + File "{{ frame.filename }}" in {{ frame.function }} + {% if frame.context_line %} + {{ frame.lineno|add:"1" }}. {{ frame.context_line|escape }} + {% endif %} +{% endfor %} +{{ exception_type }} at {{ request.path }} +{{ exception_value|escape }} +--> </body> </html> """
which puts the traceback at the start and end of the HTML page as a comment so that the developer can just see it quickly.
Note: See
TracTickets for help on using
tickets.
This is an interesting idea, but I don't think it's worth adding.