Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: Catching Template Toolkit Errors

by rinceWind (Monsignor)
on Mar 19, 2007 at 07:37 UTC ( [id://605436]=note: print w/replies, xml ) Need Help??


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.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://605436]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others romping around the Monastery: (4)
As of 2024-03-28 14:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found