Myk Melez <[EMAIL PROTECTED]> said something to this effect on 08/08/2001:
> I'd like to specify a template to catch exceptions thrown by the 
> Template Toolkit itself (f.e. syntax errors in my directives) in 
> addition to those exceptions I throw with a THROW directive.  I am 
> currently catching these exceptions like so:
> 
> $::template->process("MyTemplate.atml", $::vars)
>   || MyExceptionHandlingFunction($::template->error());
> 
> Is there any way to specify that these types of errors should be handled 
> by the template specified in the ERROR configuration option (perhaps 
> with a fall-back to an exception handling mechanism if that template 
> also fails)?

How about:

    eval {
        $::template->process("MyTemplate.atml", $::vars)
          || die $::template->error
    };
    
    MyExceptionHandlingFunction($@) if ($@);

(darren)

-- 
I accept chaos. I'm not sure whether it accepts me. I know some people
are terrified of the bomb. But then some people are terrified to be
seen carrying a modern screen magazine. Experience teaches us that
silence terrified people the most.
    -- Bob Dylan


Reply via email to