On Fri, 17 Nov 2006 07:56:02 +0100, "Marijn Haverbeke" marijnh@gmail.com wrote:
[Please use the mailing list.]
I hadn't seen aux-request-value yet -- that would definitely be better than a dynamic variable. But I'm still not crazy about the way the *http-error-handler* just kicks in when the headers are being sent. All the other stuff in my app neatly fetches an output stream, and then writes its body to it, but for non-200 pages the library just refuses to let me do this. (Which means I can't use my very nice function for filling and writing a template in this case.) Seems a bit arbitrary.
It was intended as a simple solution at a time when there was no customized error handling at all:
http://common-lisp.net/pipermail/tbnl-devel/2005-March/000197.html
I still think it is OK as far as it is in line with the way "normal" content is handled in Hunchentoot. The only real difference I can see is that you can't write directly to a stream.
Why you can't use your nice function escapes me, though. You could capture its output in a string stream, couldn't you?
If you come up with a solution that obviously improves the current situation, I'd be happy to include your patches. Bonus points if the new stuff is compatible with the old code. And note that a patch which changes user-visible behaviour should include documentation as well - I might otherwise reject it.
Cheers, Edi.
[Please use the mailing list.]
Sorry about that, happened by accident.
It was intended as a simple solution at a time when there was no
customized error handling at all:
http://common-lisp.net/pipermail/tbnl-devel/2005-March/000197.html
I still think it is OK as far as it is in line with the way "normal" content is handled in Hunchentoot. The only real difference I can see is that you can't write directly to a stream.
Why you can't use your nice function escapes me, though. You could capture its output in a string stream, couldn't you?
It currently created its own output stream by calling send-headers. I could add some scaffolding to work around this and allow it to output a string, but it clashes horribly with the structure of my code, and in this case it feels like it's the library, not the way my code works, which is making things difficult. (I might be a bit compulsive-obsessive here, I'll admit.)
If you come up with a solution that obviously improves the current
situation, I'd be happy to include your patches. Bonus points if the new stuff is compatible with the old code. And note that a patch which changes user-visible behaviour should include documentation as well - I might otherwise reject it.
The least-intrusive form I can think of now is to add another configuration special variable, named *handle-error-codes* or something similar (is error code a good term for non-200 responses at all?). This one defaults to t, but when it is set to nil then start-output does not interfere with the bodies of non-200 responses. If this sounds ok to you I'll implement it tomorrow. What is the preferred way to submit patches to the docs?
Marijn
On Fri, 17 Nov 2006 09:35:17 +0100, "Marijn Haverbeke" marijnh@gmail.com wrote:
The least-intrusive form I can think of now is to add another configuration special variable, named *handle-error-codes* or something similar (is error code a good term for non-200 responses at all?).
Yeah, "error" probably isn't completely right, but I can live with it.
This one defaults to t, but when it is set to nil then start-output does not interfere with the bodies of non-200 responses.
Sounds OK to me.
If this sounds ok to you I'll implement it tomorrow. What is the preferred way to submit patches to the docs?
diff -u like the rest.
Thanks, Edi.
Attached is the patch, I went with the name *handle-http-errors-p* instead.
Regards, Marijn
On Sat, 18 Nov 2006 08:47:55 +0100, "Marijn Haverbeke" marijnh@gmail.com wrote:
Attached is the patch, I went with the name *handle-http-errors-p* instead.
Thanks a lot - it's in the latest release.
Cheers, Edi.