views:

132

answers:

1

Hi, I am currently trying to have my Apache module repspond with custom error messages, so that a 400 for example contains additional information like "The coordinates are out of bounds".

I found multiple sources on Google saying that it is possible, but none could tell me how. So is there some function that would allow me something like:

return apache_error( 400, "Coordinate %d is out of bounds.", coord.x );

?

Thanks in advance.

+1  A: 

You can set it on the status_line member of request_rec.

snprintf(buf, buf_size, "%d Coordinate %d is out of bounds", 400, coord.x);
req->status_line = buf;
req->status = 400;
p00ya