Hi Norman,

On Saturday, May 16, 2020 at 9:16:18 PM UTC+2, Norman Gray wrote:
>
>
> But (a) what should I be doing? And (b) since that exception is caught 
> in this with-handlers clause, what is it that's producing the (default) 
> exception output message?  And (c) should I expect the client just to 
> hang here? 
>
> I'm guessing that an answer to (a) is 'avoid throwing exceptions inside 
> 'output', but given that that will sometimes happen, is the 
> output-response-body/chunked procedure doing the right thing here?  Am I 
> missing something? 
>

I suggest thinking of a servlet as a response builder, and, if possible, to 
delegate serialization of the response (output-response & friends) till 
after a response? value has been created. You can happily throw exceptions 
during the construction of the response? value; the exceptions will be 
handled by whatever scaffolding you're using for your web server (that is, 
directly handled using with-handlers of your own making that wraps the 
construction of the response?, or by the handler you gave as the value of 
#:servlet-responder in `serve/servlet`, and so on). Does that help?

Jesse

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/a8026ce9-5237-41b2-a95a-60e8eccc69bd%40googlegroups.com.

Reply via email to