perl-embperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Angus Lees <...@inodes.org>
Subject Re: error trapping and notice
Date Sat, 17 Apr 2004 14:40:00 GMT
At Thu, 15 Apr 2004 08:56:47 -0500 (CDT), Ben Kim wrote:
> 1. error trapping
> > Execute({inputfile => 'file.epl', errors => \@errors});
> > if (@errors) { Execute('notify_error.epr', \@errors); } 
> > In the "notify_error.epr" page you can send a message with all debugging
> > data you need like fdat, udat, ENV and etc.
> 
> 2. errorpage and notice
> > First configure your own error page
> > ErrorDocument 500 /errors/500.epo
> >   [-
> >     if ($req_rec && ($prev = $req_rec->prev)) {
> >       $errors = $prev->pnotes('EMBPERL_ERRORS');
> >       if ($errors && @$errors) {
> >         Execute('notify_error.epr', $errors);
> >       }
> >     }
> >   -]
> > Second disable the default error page from Embperl
> > PerlSetEnv EMBPERL_OPTIONS 262144
> 
> 3. send out a mail on every error.  (perldoc Embperl::Config)
> > Embperl_Mail_Errors_To
> > config directive 
> 
> Thanks to Luiz and Gerald for the advice. 
> 
> We are on 1.3 and are not using Embperl::Object yet. I hope I can use the
> above regardlessly. I know I can use Execute, but I'm not familiar about
> the extensions epo and epr. What is the pod that explains them?

You can use (1) without using Embperl::Object, but you need to run all
your suspect code via that construct - which is awkward without
Embperl::Object's "base" idea.

(2) should work fine, see "optReturnError" in the HTML::Embperl
manpage.

For Embperl 1.3, (3) will need to be (see HTML::Embperl manpage)
 PerlSetEnv EMBPERL_MAIL_ERRORS_TO ...

The epo and epr extensions are just Luiz's file naming conventions -
they don't mean anything special.

-- 
 - Gus


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


Mime
View raw message