Opened 14 years ago

Closed 14 years ago

Last modified 14 years ago

#8265 closed (duplicate)

Debug template exception message is confuse

Reported by: Marinho Brandão Owned by: nobody
Component: Template system Version: dev
Severity: Keywords:
Cc: Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no


When some error happens and the debug page for error 500 is shown with debug informations, the exception value is shown as a H2 element, like this:

Caught an exception while rendering: The 'image' attribute has no file associated with it. Original Traceback (most recent call last): File "../django/django/template/", line 71, in render_node result = node.render(context) File "../django/django/template/", line 148, in render nodelist.append(node.render(context)) File "../django/django/template/", line 87, in render output = force_unicode(self.filter_expression.resolve(context)) File "../django/django/template/", line 518, in resolve obj = self.var.resolve(context) File "../django/django/template/", line 659, in resolve value = self._resolve_lookup(context) File "../django/django/template/", line 688, in _resolve_lookup current = getattr(current, bit) File "/arquivos/Trabalhos/WN/Cranes/cranes_com/apps/spares/", line 108, in __getattr__ thumbnail = get_image_thumbnail_filename() File "/arquivos/Trabalhos/WN/Cranes/cranes_com/apps/spares/", line 100, in get_image_thumbnail_filename file, ext = os.path.splitext(self.image.path) File "../django/django/db/models/fields/", line 50, in _get_path self._require_file() File "../django/django/db/models/fields/", line 40, in _require_file raise ValueError("The '%s' attribute has no file associated with it." % ValueError: The 'image' attribute has no file associated with it. 

This is VERY confuse and make developer spent some time to find the error message and the file/line where the error occured.

My suggestion is change the H2 tag to PRE, with some CSS changes, so, the line breaks are respected exactly as they are when Python raises the exception.

Attachments (1)

8265.diff (753 bytes) - added by Marinho Brandão 14 years ago.

Download all attachments as: .zip

Change History (3)

Changed 14 years ago by Marinho Brandão

Attachment: 8265.diff added

comment:1 Changed 14 years ago by Malcolm Tredinnick

Resolution: duplicate
Status: newclosed

This is basically the same as #8178.

comment:2 Changed 14 years ago by (none)

milestone: 1.0 maybe

Milestone 1.0 maybe deleted

Note: See TracTickets for help on using tickets.
Back to Top