Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jetty-users] InputStreamContentProvider wrapping exceptions


On Thu, Mar 26, 2015 at 11:19 PM, John Gardiner Myers
<jgmyers@xxxxxxxxxxxxxx> wrote:
> On 3/26/2015 3:03 PM, John Gardiner Myers wrote:
>> wraps failures in a
>> NoSuchElementException, presumably because it can't throw an IOException.
>> Unfortunately, this tends to obscure the real failure.
>> Would it make sense for ContentCallback.process() to unwrap the
>> NoSuchElementException when it has a cause?
> Or perhaps the problem is that Jetty let the exception propagate out of
> HttpRequest.send() instead of swallowing it somewhere. When it propagates
> out of HttpRequest.send(), the caller is likely to act on (or propagate)
> that an not even look at the Listener.

Jetty client does swallow the exception and fails the callback,
resulting in the complete event being triggered, see
HttpSender.send[Headers|Content]() catch-all block.
The unwrapped exception actually tells me that it happened while you
were reading the request content of a request to a server, so you're
actually using Jetty's HttpClient as a kind of proxy.
I would not have known that by just reading the unwrapped exception,
so seems even useful to me...

Simone Bordet
Developer advice, training, services and support
from the Jetty & CometD experts.
Intalio, the modern way to build business applications.

Back to the top