Seems to my mail web-interface broke text formatting, sorry. There is a patch as is in the attachment.
On Sun, Oct 17, 2010 at 11:40 AM, Blond BF blondbf@gmail.com wrote:
So there was the need to handle the HTTP 500 error in two different ways depending on the current request string. So I threw error formatting code from START-OUTPUT and PROCESS-REQUEST to a separate function for start. Then I tried to make this function context-depended so I set the default value of *HTTP-ERROR-HANDLER* to this function and put error detection and handling code to HANDLE-REQUEST.
Now HANDLE-REQUST responds to lisp and http errors by calling *HTTP-ERROR-HANDLER* and passing to it condition and backtrace in case of lisp error and dispatcher's return value in case of HTTP error. This error handler looks at RETURN-CODE* and formats corresponding error message. START-OUTPUT and PROCESS-REQUEST now just write what HANDLE-REQUEST returns.
Now I can do something like (let ((*http-error-handler* 'custom-handler-for-this-site... in the dispatcher.
There is little problem with compatibility: *HTTP-ERROR-HANDLER* takes error code as single argument before but now it taking error description string as single argument (can take return-code from reply object). I have no idea to save backward compatibility here.
Here is a draft patch: ...