[hunchentoot-devel] HTTP 500 error handling behavior customization
Blond BF
blondbf at gmail.com
Sun Oct 17 07:53:05 UTC 2010
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 at 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:
> ...
-------------- next part --------------
A non-text attachment was scrubbed...
Name: hunchentoot-patch
Type: application/octet-stream
Size: 13571 bytes
Desc: not available
URL: <https://mailman.common-lisp.net/pipermail/tbnl-devel/attachments/20101017/7f3346ba/attachment.obj>
More information about the Tbnl-devel
mailing list