Hi Blond,
I'm sorry for not having responded to your proposed patch earlier. With my recent changes to Hunchentoot's error handling, your patch won't apply cleanly anymore. I will review it and come up with some functionality similar to what your patch implemented.
-Hans
On Sun, Oct 17, 2010 at 9:53 AM, Blond BF blondbf@gmail.com wrote:
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: ...
tbnl-devel site list tbnl-devel@common-lisp.net http://common-lisp.net/mailman/listinfo/tbnl-devel