On 10 Jun 2006, at 07:39, Malcolm Tredinnick wrote:

> What's our policy on template filters failing? If applying a filter
> raises an error, should we just trap it and return the empty  
> string, or
> raise an error? I can't find this written down anywhere, but maybe  
> I've
> missed it.

The original policy has always been that errors in template filters  
should fail silently - the idea being that it shouldn't be possible  
to "break" a site by editing a template.

With hindsight, I think that this was a mistake. An error in a  
template is still an error, and needs to be caught. Failing silently  
just means pages stay broken without the website maintenance team  
hearing about it.

One particularly nasty example of this is the markdown / textile  
filters. At the moment, these will fail silently if the markdown or  
textile modules aren't installed - they will just output the string  
that was piped to them. Imagine you have markdown/textile installed  
on your development machine but not on your production machine. You  
upload your site but forget to test the pages in question - as a  
result, visitors to the site see unformatted markdown instead of HTML.

In this case, throwing and logging an error is much preferable to  
failing silently.

Cheers,

Simon

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to