Re: [Templates] Unexpected errors with COMPILE_DIR and TOLERANT

[prev] [thread] [next] [Date index for 2004/12/22]

From: Simon Flack
Subject: Re: [Templates] Unexpected errors with COMPILE_DIR and TOLERANT
Date: 15:20 on 22 Dec 2004

Andy Wardley wrote:
> Simon Flack wrote:
> 
>>    $tt->process($template, { data => 'Hello World' }, \$output);
> 
> 
> You're ignoring any error that is returned.  That should be:
> 
>       $tt->process(...)
>            || die $tt->error();

I had a 'Test::More::diag($tt->error)' a couple of lines down. I could 
have done:
	$tt->process(...) || diag $tt->error

but I wanted the error to appear after the test failure.

>>The wording of the error for the second test is a suprise - the template 
>>exists, it's just not able to cache the compiled version.
> 
> 
> That's the error thrown by File::Path::mkpath at line 877.
> 
> 
>>But I expected all three tests to pass, and for TT to silently skip the 
>>caching errors with TOLERANT => 1.
> 
> 
> Yep, that mkpath should probably be wrapped in an eval to catch the error
> and ignore it if TOLERANT is set.  I've patched the code (in CVS) but it's 
> waiting for someone to write a proper test for it (e.g. in t/compile4.t).

Thank you. If I enable TOLERANT, what other errors will I be tolerating? 
I only want to tolerate failures caching compiled templates, not other 
more important errors like template syntax or missing templates.

Simon

_______________________________________________
templates mailing list
templates@xxxxxxxxxxxxxxxx.xxx
http://lists.template-toolkit.org/mailman/listinfo/templates

(message missing)

Re: [Templates] Unexpected errors with COMPILE_DIR and TOLERANT
Simon Flack 15:20 on 22 Dec 2004

Generated at 08:56 on 15 Mar 2005 by mariachi v0.52