Re: [Templates] Unexpected errors with COMPILE_DIR and TOLERANT

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

From: Andy Wardley
Subject: Re: [Templates] Unexpected errors with COMPILE_DIR and TOLERANT
Date: 09:40 on 22 Dec 2004
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();

> 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).

Cheers
A



_______________________________________________
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
Andy Wardley 09:40 on 22 Dec 2004

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