[Templates] missing fatal errors

[prev] [thread] [next] [Date index for 2005/01/05]

From: Dave Howorth
Subject: [Templates] missing fatal errors
Date: 09:45 on 05 Jan 2005
I'd like to see all errors that occur when I'm processing a template but 
it seems that some are suppressed. I have a library module that is dying 
because I didn't configure it properly but I'm not seeing any indication 
of the problem either in my logs or in the generated output. The module 
dies when one of its methods is called in a template, because some other 
method is not installed. Once I localized the problem, I ran it 
freestanding and saw an error message like:

    Can't locate object method "no_way" via package "Test"

But when I run it inside a template, the template processing completes 
normally with no hint of an error! Is there any way to tell TT that when 
my program dies, I'd like to know about it?

I can reproduce the symptoms with this test prog and template:

test.pl:
=======
package Test;

use Template;

my $tt = Template->new( {
          INCLUDE_PATH => [ '.' ],
      } );

my $out;
if($tt->process('foo.tt', {}, \$out)) {
     print "normal - ", $out
} else {
     die "error - ", $tt->error;
}

sub foo {
print STDERR "\nentering foo\n";
   my $self = shift;
   $self->no_way();
print STDERR "\nleaving foo\n";
}

1;

foo.tt:
======

HELLO from foo.tt
[% USE me = Class('Test') ; me.foo %]
GOODBYE


and the output:
==============

entering foo
normal - HELLO from foo.tt

GOODBYE

Thanks and regards,
Dave


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

[Templates] missing fatal errors
Dave Howorth 09:45 on 05 Jan 2005

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