Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[jetty-dev] Servlet response failure detection

Hi there,
 
I'm working on something that uses jetty to respond to http requests, and I'm stuck on a problem and could really use some advice/help. I hope this is the right place to ask.
 
My issue is that I would like to know if the response generated any errors or exceptions when it gets sent to the client. From what I can tell, it seems that jetty handles the actual sending of the response, so I'm not quite sure what to do. I tried writing the response directly to the output stream from the ContainerResponse and then flushing it, and managed to catch an exception this way, but this basically bypasses any processing jetty might do before actually sending the response, which seems pretty dangerous to me.
 
I know that there is no guarantee that sending a response will generate an exception if the client is no longer connected, but in this specific case, I know it is generating an exception. I just can't figure out how I can retrieve it. Is there some way of setting a callback, or retrieving an error code related to a particular response?
 
 
Thanks,
 
Mandor

Back to the top