James Bennett wrote on 05/18/08 06:30:
> On Wed, May 14, 2008 at 8:58 AM, Simon Willison <[EMAIL PROTECTED]> wrote:
>> Silent errors are bad. If we were to remove them, how much of a
>> negative impact would it have on the existing user base?
>
> The impression I get is that a lot of people rely on silent *variable*
> failure, but very few rely on silent *tag* failure. In fact, most
> real-world custom template tags I've seen are wired up to raise errors
> quite loudly, and the few times I've tried to write tags which fail
> silently it's been a laborious process that results in much more
> brittle code.
>
> And, really, variables are the big thing that the current behavior
> helps: it's really really nice to be able to do boolean tests on
> things that might not exist, and trust that the test evaluates False
> instead of, say, raising a KeyError because you asked about something
> that isn't in the context dictionary.
>
> So, personally, I'd vote for keeping the current behavior with respect
> to variables, and rewriting any built-in tags to raise exceptions when
> you do something wrong.
>
+1
What I personally would like to see is that such errors where logged
somewhere. I know this came up before, and that the django devs, for
whatever reasons, think it's not necessary.
But something like:
try:
whatever
except SomeTemplateError, e:
logger.debug('Template Error: %s', e)
Would IMHO be the most elegant solution.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/django-developers?hl=en
-~----------~----~----~----~------~----~------~--~---