Your Ad Here

Friday, January 13, 2012

Django silences exceptions raised by functions called during template rendering

Hi guys,

Using django 1.1.1
Example template snippet template snippet:

{{ foo.bar }}

If 'bar' raises an AttributeError, the exception is silenced and an
empty string is displayed.
I tried setting DEBUG, TEMPLATE_DEBUG, and DEBUG_PROPAGATE_EXCEPTIONS
to True, but nothing changes.

Digging through django's source code, it looks like silencing the
error is a normal django behavior.

Should this be considered a bug in django? I mean, even though the bug
is in 'my' code and that code should be unit tested decoupled from the
template rendering part, it would be nice to have a setting for
showing the same django error page as if the exception would have been
raised in the view code.

Thanks

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

0 comments:

Post a Comment