#8178 closed (fixed)
Insert linebreaks in debug summary
Reported by: | Julien Phalip | Owned by: | nobody |
---|---|---|---|
Component: | Uncategorized | Version: | dev |
Severity: | Keywords: | ||
Cc: | Triage Stage: | Ready for checkin | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
When exceptions are raised, in particular in templates (e.g. with URL tag not matching a view), you get a big chunk of traceback info in the debug summary which is hard to read. Inserting linebreaks helps a lot. Patch attached.
Before:
Caught an exception while rendering: Original Traceback (most recent call last): File "E:\Software\workspace\django\django\template\debug.py", line 71, in render_node result = node.render(context) File "E:\Software\workspace\django-treemenus\trunk\treemenus\templatetags\tree_menu_tags.py", line 46, in render return urlNode.render(context) File "E:\Software\workspace\django\django\template\defaulttags.py", line 369, in render args=args, kwargs=kwargs) File "E:\Software\workspace\django\django\core\urlresolvers.py", line 307, in reverse *args, **kwargs))) File "E:\Software\workspace\django\django\core\urlresolvers.py", line 291, in reverse raise NoReverseMatch NoReverseMatch
After:
Caught an exception while rendering: Original Traceback (most recent call last): File "E:\Software\workspace\django\django\template\debug.py", line 71, in render_node result = node.render(context) File "E:\Software\workspace\django-treemenus\trunk\treemenus\templatetags\tree_menu_tags.py", line 46, in render return urlNode.render(context) File "E:\Software\workspace\django\django\template\defaulttags.py", line 369, in render args=args, kwargs=kwargs) File "E:\Software\workspace\django\django\core\urlresolvers.py", line 307, in reverse *args, **kwargs))) File "E:\Software\workspace\django\django\core\urlresolvers.py", line 291, in reverse raise NoReverseMatch NoReverseMatch
Attachments (2)
Change History (15)
by , 16 years ago
Attachment: | 8178.linebreaks.diff added |
---|
comment:1 by , 16 years ago
milestone: | → 1.0 beta |
---|---|
Triage Stage: | Unreviewed → Ready for checkin |
comment:2 by , 16 years ago
milestone: | 1.0 beta → 1.0 |
---|
follow-up: 5 comment:4 by , 16 years ago
Why not show the exception message as PRE instead of H2 in template?
In my opinion would be better, because the formatting (including spaces) would be respected and be better as look :)
I created a ticket similar to this (I didn't know about this), take a look on that: #8265
comment:5 by , 16 years ago
Replying to marinho:
Why not show the exception message as PRE instead of H2 in template?
In my opinion would be better, because the formatting (including spaces) would be respected and be better as look :)
Marinho, you're making a good point. The patch you've submitted in #8265 is indeed much better, and it should be used instead of the one I've submitted here.
comment:6 by , 16 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
comment:7 by , 16 years ago
You forgot to do the same where it says "Exception value". Here the fix:
Index: django/views/debug.py =================================================================== --- django/views/debug.py (revision 8409) +++ django/views/debug.py (working copy) @@ -405,7 +405,7 @@ </tr> <tr> <th>Exception Value:</th> - <td>{{ exception_value|escape }}</td> + <td><pre>{{ exception_value|escape }}</pre></td> </tr> <tr> <th>Exception Location:</th>
comment:8 by , 16 years ago
Resolution: | fixed |
---|---|
Status: | closed → reopened |
Not reopening the ticket won't help the oversight get fixed.
comment:9 by , 16 years ago
Resolution: | → fixed |
---|---|
Status: | reopened → closed |
comment:10 by , 16 years ago
Resolution: | fixed |
---|---|
Status: | closed → reopened |
Sorry to re-re-open this, but Marinho's patch hadn't been applied correctly. The error message should not have a sans-serif font.
Patch attached.
by , 16 years ago
Attachment: | 8178.stylefix.diff added |
---|
The error message should not have a sans-serif font.
comment:11 by , 16 years ago
Resolution: | → fixed |
---|---|
Status: | reopened → closed |
Is your complaint about the serifs, or using a non-monospaced font? Using Helvetica/Arial family (non-monospaced, sans serif) was a conscious decision, because a big block of large, seriffed, monospaced text looks awful, and I couldn't see any loss in usability for the text that is returned.
comment:12 by , 16 years ago
Thanks Russell for the info, and sorry for the noise. I wasn't sure if it was a mistake or a deliberate choice. Your reasons for keeping Helvetica/Arial totally make sense and I'm fine with it ;)
This is only a small improvement and that doesn't quite fit in the 1.0 beta milestone.