CC: | Ovid <publiustemp-pdxpm [...] yahoo.com> |
Subject: | Bug in Template::Service Exception Handling |
Date: | Mon, 13 Feb 2006 18:54:27 -0800 |
To: | bug-template-toolkit [...] rt.cpan.org |
From: | David Wheeler <dwheeler [...] cpan.org> |
If a template is handling an object that throws its own exception
objects (not strings, but real objects, such as defined by
Exception::Class), Template::Service tries to call a
Template::Exception method that likely does not exist in the
exception object. This patch seems to fix the bug for me, so that my
exception properly percolates up and appears in my error log.
--- lib/Template/Service.pm.old 2006-02-13 18:50:29.000000000 -0800
+++ lib/Template/Service.pm 2006-02-13 18:50:53.000000000 -0800
@@ -204,7 +204,7 @@
# point... unless a module like CGI::Carp messes around with the
# DIE handler.
return undef
- unless (ref $$error);
+ unless eval { $$error->isa('Template::Exception') };
# a 'stop' exception is thrown by [% STOP %] - we return the
output
# buffer stored in the exception object
Thanks!
David