Re: Consistent exception handling in templates.

2011-07-10 Thread burc...@gmail.com
Could we summarize in few words? | DEBUG (development) | not DEBUG (production) TEMPLATE_DEBUG | raise TemplateSyntaxError | ? not TEMPLATE_DEBUG| ? | ? On Sat, Jul 9, 2011 at 12:53 PM, Tai Lee wrote: > > > On Jul 9, 12:24 pm, Kar

Re: Consistent exception handling in templates.

2011-07-08 Thread Tai Lee
On Jul 9, 12:24 pm, Karen Tracey wrote: > I'm strongly against that idea. Swallowing errors makes it incredibly > difficult to debug errors. I would prefer for the `TEMPLATE_DEBUG` setting to > turn off much of the error-silencing currently done in template processing. > Yes, that means differen

Re: Consistent exception handling in templates.

2011-07-08 Thread Karen Tracey
On Fri, Jul 8, 2011 at 9:55 PM, Tai Lee wrote: > Secondly, there is the inconsistent behaviour between production and > development environments related to the `TEMPLATE_DEBUG` setting. I > think that if an exception is intentionally silenced in production, it > should also be intentionally silen

Re: Consistent exception handling in templates.

2011-07-08 Thread Tai Lee
On Jul 8, 11:31 pm, Jacob Kaplan-Moss wrote: > > [...] but some of Django's own template tags (e.g. `widthratio`) don't > > adhere to > > this policy. > > These are bugs, and should be fixed. Thanks for this clarification. I will try to review the built-in tags and submit some patches to fix t

Re: Consistent exception handling in templates.

2011-07-08 Thread Jonas H.
On 07/08/2011 05:24 PM, Jonathan Slenders wrote: My feeling is that we should silence TypeError, AttributeError and KeyError in _resolve_lookup, but only when they occur one frame deep. I agree with what you propose but AFAIK it's not easy to solve without doing frame analysis (I'd say that fe

Re: Consistent exception handling in templates.

2011-07-08 Thread Jonathan Slenders
Something related I was wondering about... Errors in templates should be silenced -- I agree with that -- but only when they are caused by an error in the template. Variable.resolve can fail silent because that's caused by the template author, who is referring to non-existing variables. However,

Re: Consistent exception handling in templates.

2011-07-08 Thread Jacob Kaplan-Moss
s own template tags (e.g. `widthratio`) don't adhere > to > this policy. These are bugs, and should be fixed. > I'd like to see a move towards consistent exception handling in > templates for template tags and filters. I'd like to see no exceptions > silenced by d

Consistent exception handling in templates.

2011-07-07 Thread Tai Lee
xceptions, with either option possibly hiding problems that exist elsewhere in the code (in a function called by the template tag). I'd like to see a move towards consistent exception handling in templates for template tags and filters. I'd like to see no exceptions silenced by default, but p