Hi all,

On Thursday, April 18, 2002, at 04:58 PM, Geoffrey Young wrote:

>> I'm a little confused (honestly). I want to handle parameter errors in 
>> a content handler. When there's a parameter missing in the URL, my 
>> handler returns HTTP_BAD_REQUEST.
>> Now Apache sees the HTTP_BAD_REQUEST return value from my handler and 
>> generates an error (HTML) document.
>> How can I create this document right from within my handler? I could 
>> create another handler of course and use the ErrorDocument directive 
>> to point to that but I am wondering if I can do it in my handler 
>> directly.
>> Somehow I can't find this in the eagle book.
>
> look for $r->custom_response

I did, even before my post ;) My confusion was caused by the client 
testing tool I used: lwp-request. Apparently, it generates 
HTML-formatted documents in error conditions that *do not come from the 
webserver*. I was doing something like this:

$request->custom_response(HTTP_NOT_ACCEPTABLE,'invalid request 
(application identifier not found)');

return (HTTP_NOT_ACCEPTABLE);

Expecting a plain text document in the response. lwp-request however 
creates an HTML document itself and displays that. Going in with telnet 
to the appropriate port etc. revealed this was actually working as 
advertised.

One of those 'put it in quickly at the end of the day' things ;)

Bas.

Reply via email to