perl-embperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kee Hinckley <naz...@somewhere.com>
Subject Trapping internal errors in HTML::EmbperlObject
Date Wed, 07 Aug 2002 13:40:57 GMT
I want my templates to catch errors on the executed file and display 
a reasonable page instead.  (And mail me the error.)

I tried this:

[- Execute({isa => 'SiteInit.html'}); -]
[-
      my @errors;
      Execute({inputfile => '*', errors => \@errors});
      if (@errors) {
          Execute({inputfile => "ierror.html", param => \@errors});
      }
-]

and in ierror.html I display some stuff and then do:

     HTML::Embperl::Mail::Execute ({inputfile => 
"$ENV{DOCUMENT_ROOT}/data/ierror.epl",
                                    subject   => "Internal Error on 
$ENV{SERVER_NAME}",
                                    from      => 
'webmaster@masscharterschools.org',
                                    to        => $ENV{SERVER_ADMIN},
                                    param     => \@param,
                                    }) ;

Oddly though, not only does that not get rid of the error page, it 
dislays the error message twice:

  [32683]ERR: 24: Line 124: Error in Perl code: Can't use an undefined 
value as a HASH reference at 
/usr/local/www/mcsa-stage/data/SWC/Commons.pm line 1326.

[32683]ERR: 24: Line 17: Error in Perl code: [32683]ERR: 24: Line 
124: Error in Perl code: Can't use an undefined value as a HASH 
reference at /usr/local/www/mcsa-stage/data/SWC/Commons.pm line 1326. 
at /usr/lib/perl5/site_perl/5.005/i386-linux/HTML/Embperl/Mail.pm 
line 56.


Apparently something isn't getting cleared, so the Mail::Execute fails.

I also tried setting optReturnError, but that doesn't appear to do 
anything either.
-- 

Kee Hinckley - Somewhere.Com, LLC
http://consulting.somewhere.com/

I'm not sure which upsets me more: that people are so unwilling to accept
responsibility for their own actions, or that they are so eager to regulate
everyone else's.

---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org


Mime
View raw message