Mailing List Archive

Server Errors
I'm trying to trap the server errors that occur when embperl hits
something
that is incorrectly configured.

i.e. someone puts in [+ $foo $]

Now normally, I would expect this to generate an HTTP error 500.
And under Apache I can "trap" this kind of error to a script handler.

It seems like Embperl has a different mechanism for returning these
errors.

Can anyone offer me some help/thoughts with regards to this?

My goal is to take the "error" that embPerl generates - package it up
nicely and display it on the screen - and give my users a button to send

me the error.

-Tom
RE: Server Errors [ In reply to ]
>
> I'm trying to trap the server errors that occur when embperl hits
> something
> that is incorrectly configured.
>
> i.e. someone puts in [+ $foo $]
>
> Now normally, I would expect this to generate an HTTP error 500.
> And under Apache I can "trap" this kind of error to a script handler.
>
> It seems like Embperl has a different mechanism for returning these
> errors.
>
> Can anyone offer me some help/thoughts with regards to this?
>

From the docs:
optReturnError = 262144
With this option set Embperl sends no output in case of an error, instead it
returns the error back to Apache or the calling programm. When running under
mod_perl this gives you the chance to use the Apache ErrorDocument directive
to show a custom error-document.

> My goal is to take the "error" that embPerl generates - package it up
> nicely and display it on the screen - and give my users a button to send
> me the error.
>

The problem is that you don't have access to the Embperl error message
inside your error document. You need to add the following lines in
Embperl.pm in function handler directly before the call to Execute (about
line 1210):

my @errors ;
$req{'errors'} = \@errors ;
$req_rec -> pnotes ('EMBPERL_ERRORS', \@errors) ;

then you can retrives the errors in your error handler via the $r -> pnotes
('EMBPERL_ERRORS') ;


the other possibility is to use:

EMBPERL_MAIL_ERRORS_TO
If set all errors will be send to the email adress given.

Hope this helps

Gerald

-------------------------------------------------------------
Gerald Richter ecos electronic communication services gmbh
Internetconnect * Webserver/-design/-datenbanken * Consulting

Post: Tulpenstrasse 5 D-55276 Dienheim b. Mainz
E-Mail: richter@ecos.de Voice: +49 6133 925151
WWW: http://www.ecos.de Fax: +49 6133 925152
-------------------------------------------------------------