I'm pretty sure you should be using Apache2::Const::SERVER_ERROR, not the HTTP_* constants. This could probably be documented better. You should likely be returning that constant instead of the HTTP_* ones as well.

Adam

On 14-03-18 11:59 AM, John Dunlap wrote:
I recently upgraded my workstation from Debian 6 to Debian 7 and I'm now
encountering a problem that I haven't seen before. My apache version
is 2.2.22-13+deb7u1. My mod_perl version is 2.0.7-3. I'm guessing that I
have an installation problem of some kind but I'm not sure where to look
for problems. My application works correctly until I attempt to define a
custom response, as follows,

sub handler {
my $apache = shift;
$apache->custom_response(Apache2::Const::HTTP_INTERNAL_SERVER_ERROR, 'hi
mom');
return Apache2::Const::HTTP_INTERNAL_SERVER_ERROR;
}

I see a 500 error, which is what I want, when I access the page. However
the error page is the default apache 500 error response page and I want
to override it. When I look in the logs, I see this:

[Tue Mar 18 15:41:32 2014] [error] [client 127.0.0.1] Can't locate
object method "custom_response" via package "Apache2::RequestRec" at
/usr/local/lariat-trunk/qa-trunk/lib/Lariat/V4/WS/RS/BootstrapHandler.pm
line 41.

This would imply, at least to me, that this method is not compiled into
mod_perl or perhaps into apache itself but I cannot be sure. Any
suggestions?

Cheers!
John


Reply via email to