You are viewing a plain text version of this content. The canonical link for it is here.
Posted to embperl@perl.apache.org by Michael Smith <sm...@gmail.com> on 2006/01/03 15:54:10 UTC
404s not being handled correctly
I saw something similar to this a while back on the list, but I'm still
having problems with Emberl 2.1.0
When I access a non-existant epl file I see this in the browser:
--
Internal Server Error The server encountered an internal error or
misconfiguration and was unable to complete your request.
Please contact the server administrator, [email address] and inform them of
the time the error occurred, and anything you might have done that may have
caused the error.
[22142]ERR: 404: asdfsdfsjdf.epl(1): Not found
'/www/common/docs/asdfsdfsjdf.epl', searched: No such file or directory
Apache Embperl 2.1.0 [Tue Jan 3 14:49:14 2006]
--
In the apache error logs I see
[Tue Jan 3 14:52:33 2006] [error] [22142]ERR: 404: asdfsdfsjdf.epl(1): Not
found '/www/common/docs/asdfsdfsjdf.epl', searched: No such file or
directory
In this case I don't have EMBPERL_OPTIONS set, but my intention is to set
this and see a custom 404 error page. However I get my custom 500 error
page instead.
Is this a problem with Embperl or a problem with me?
Thanks
Michael
RE: 404s not being handled correctly
Posted by Gerald Richter <ri...@ecos.de>.
>
> Is there a way that the script invoked by ErrorDocument 500
> can determine that is was really a 404 error?
>
The list of errors is stored in a pnote (See
http://perl.apache.org/embperl/pod/doc/Embperl.-page-13-.htm). You can get
it from there and check if there is only one 404 in the list.
Gerald
** Virus checked by BB-5000 Mailfilter **
---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org
Re: 404s not being handled correctly
Posted by Michael Smith <sm...@gmail.com>.
At the moment in Embperl all error are handled the same and gives a 500
> error. I have to handle the not found case special to return the 404
> error,
> which of course makese sense. I will take a look at it during the next
> days.
Thanks Gerald,
Is there a way that the script invoked by ErrorDocument 500 can determine
that is was really a 404 error?
Michael
RE: 404s not being handled correctly
Posted by Gerald Richter <ri...@ecos.de>.
Hi,
>
> The tests all pass
>
> When I have optReturnError not set (EMBPERL_OPTIONS=0) and no
> ErrorDocument directive I see the 'internal server error' I
> sent before.
>
> When I have optReturnError (EMBPERL_OPTIONS = 262144) and
> ErrorDocument set then I see the page for ErrorDocument 500
> directive rather than that for the 404, which I thought might
> be related to seeing internal server error when
> optReturnError isn't set.
>
> Any suggestions as to where I look to try and resolve this?
>
At the moment in Embperl all error are handled the same and gives a 500
error. I have to handle the not found case special to return the 404 error,
which of course makese sense. I will take a look at it during the next days.
When you use Embperl::Object it's already handled corretcly, that was what
the discussion on the maillist you refered was about.
> Incidentally this page
> http://perl.apache.org/embperl/pod/doc/Embperl.-page-13-.htm
> says that optReturnError is set in EMBPERL_DEBUG ... I
> presume EMBPERL_OPTIONS is correct
Yes, EMBPERL_OPTIONS is correct
>
> Thanks, and Happy New Year!
>
The same to you
Gerald
** Virus checked by BB-5000 Mailfilter **
---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org
Re: 404s not being handled correctly
Posted by Michael Smith <sm...@gmail.com>.
Hi Gerald,
The tests all pass
When I have optReturnError not set (EMBPERL_OPTIONS=0) and no ErrorDocument
directive I see the 'internal server error' I sent before.
When I have optReturnError (EMBPERL_OPTIONS = 262144) and ErrorDocument set
then I see the page for ErrorDocument 500 directive rather than that for the
404, which I thought might be related to seeing internal server error when
optReturnError isn't set.
Any suggestions as to where I look to try and resolve this?
Incidentally this page
http://perl.apache.org/embperl/pod/doc/Embperl.-page-13-.htm says that
optReturnError is set in EMBPERL_DEBUG ... I presume EMBPERL_OPTIONS is
correct
Thanks, and Happy New Year!
Michael
On 1/4/06, Gerald Richter <ri...@ecos.de> wrote:
>
> >
> > In this case I don't have EMBPERL_OPTIONS set, but my
> > intention is to set this and see a custom 404 error page.
> > However I get my custom 500 error page instead.
> >
> > Is this a problem with Embperl or a problem with me?
> >
>
> You need to set optReturnError, and add an ErrorDocument directive to your
> httpd.conf. This should work with Embperl 2.1.0, as you described it. If
> not
> we should take a deeper look at it. Make test has a test for it, so the
> first question would be if make test suceeds without problems?
>
> Gerald
>
>
>
> ** Virus checked by BB-5000 Mailfilter **
>
>
RE: 404s not being handled correctly
Posted by Gerald Richter <ri...@ecos.de>.
>
> In this case I don't have EMBPERL_OPTIONS set, but my
> intention is to set this and see a custom 404 error page.
> However I get my custom 500 error page instead.
>
> Is this a problem with Embperl or a problem with me?
>
You need to set optReturnError, and add an ErrorDocument directive to your
httpd.conf. This should work with Embperl 2.1.0, as you described it. If not
we should take a deeper look at it. Make test has a test for it, so the
first question would be if make test suceeds without problems?
Gerald
** Virus checked by BB-5000 Mailfilter **
---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org