Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Web CMS (TeamSite)
Failed Page Generation
alanhill
Hi,
We've been using 5.5.1 for a while now (not a typo, just a little known version - almost the same as 5.5.2). We've been living with the fact that if a generate process fails for some reason (usually a problem with the tpl) the user gets no helpful information on screen as to why the generate failed.
This always seemed a glaring miss with templating - not being able to see why a page generation failed.
We're just about to move to 6.5 (Windows 2003) and I was wondering if there was now a way to direct any output (eg from a Perl 'die' command) to the screen so the user could see why it had failed, at least to allow something meaningful to be passed to the support teams.
Ideally I'd like to create a custom html (error handler) page which could take the error output and wrap it with nice business friendly speak recommending what they do next, and perhaps giving them a link to a log file for more information.
Any ideas?
Teamsite Template Developer
Find more posts tagged with
Comments
Adam Stoller
The Perl way is to redirecte the output of both STDOUT and STDERR into a variable (or set of variables) when you run the command to generate the page, and if an error occurs to display the content of that variable wherever you want it (CGI window if one exists, logfile, etc.). E.g.:
...
use CGI::Carp qw(fatalsToBrowser);
...
my $results = qx($cmd 2>&1);
if ($?){
die("$cmd failed:\n======\n$results\n=======\n");
}
...
--fish
Senior Consultant, Quotient Inc.
http://www.quotient-inc.com