Kenny Smith <[EMAIL PROTECTED]> wrote:
>
> Is the only way to catch the internal H::T errors (like "attempt to
> set parameter 'extra_urls' with a scalar - parameter is not a
> TMPL_VAR!") by doing all of my H::T inside an eval and checking the
> magic error variables?
yes, but not *all* of your H::T code, just the parts that are likely to
throw errors. the error you mention, for example, would only be thrown
during the $template->param() call, so you could just wrap that one
statement in an eval, if that's the kind of error you want to handle, as
opposed to parse errors like badly nested loops, broken tmpl syntax,
etc.
also if you're doing CGI programming and are just annoyed by apache's
less-than-enlightening 500 Server Errors while you're writing/debugging
code, don't forget about:
use CGI::Carp qw( fatalsToBrowser);
which can trap those perl die messages for you and display them in the
browser right away so you don't have to monitor the error log.
but don't leave fatalsToBrowser running on a public URL because the raw
error messages *might* just give would-be hackers more info than they
might otherwise have, like the absolute paths to scripts and whatnot...
CGI::Carp also lets you hook in your *own* callback to be used to
generate the HTML displayed for perl exceptions, so this could be used
to s/ubsti/tute/ or strip the error messages down to something less
revealing, but again, it's a bit risky as you never know what perl's
last words might be as it's dying...
-dave
-------------------------------------------------------
This sf.net email is sponsored by: OSDN - Tired of that same old
cell phone? Get a new here for FREE!
https://www.inphonic.com/r.asp?r=sourceforge1&refcode1=vs3390
_______________________________________________
Html-template-users mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/html-template-users