On 28/05/07, Tim Bray <[EMAIL PROTECTED]> wrote:
On May 27, 2007, at 11:31 AM, Nick Kew wrote:
>> Scenario: I'm about to punt a request using HTTP_FORBIDDEN and I'd >> like to generate a helpful response body explaining why. > > The easy way is to delegate that to the admin with ErrorDocument. In general I'd agree, but in this particular case the code inside the module knows specifics about what's gone wrong, and can provide a high-quality error readout.
If using multilingual error documents, for some number of them if you set 'error-notes' in request_rec->notes, then it will render that text as part of the error page. This is because Apache treats 'error-notes' as special and will translate that into a ERROR_NOTES attribute in request_rec->subprocess_env for the sub request used to invoke an ErrorDocument. The multilingual error documents, which use SSI, thus pick up ERROR_NOTES and display it. Your handler could also follow this convention and set 'error-notes'. You could then supply your own ErrorDocument handler which picks up ERROR_NOTES and similarly displays it. Graham
