http://qs1969.pair.com?node_id=605436


in reply to Catching Template Toolkit Errors

How are you using Template Toolkit? Maybe you are ignoring errors that you are getting. You haven't posted any code, so I cannot see whether this is the case.

In the manual are examples that check the return value from process and die with the error method when unsuccessful. This will result in diagnostics on stderr. Is your code doing this?

--
Apprentice wetware hacker

Replies are listed 'Best First'.
Re^2: Catching Template Toolkit Errors
by Herkum (Parson) on Mar 19, 2007 at 11:55 UTC

    I looked at the piece of code that you mentioned and maybe part of the problem is that I am using cpan:://CGI::Application::Plugin::TT The plugin does not mention much in reference to Template errors except that I can have an 'Error' runmode to display the an error template.

    I was hoping there was a variable that could be set when initializing the Template configuration that would force the template to die with the error message or stick the error in a value that is accessible by the template.

    Update: I am also wondering if might have to do with the way CGI::Application handles carp calls on a Win32 box. I looked at the source code for the plugin and it calls croak which, I don't think should be a problem, but I am not sure how it is being handled.

    Update 2: Evidently CGI::Application does its own eval on executed code and sticks in the $@ variable and will call the error runmode. I cannot wait to get home to see if this works.