users@jax-rs-spec.java.net

[jax-rs-spec users] [jsr339-experts] Re: Re: Re: Ad JAX_RS_SPEC-257: Unification of MessageProcessingException and ClientException

From: Bill Burke <bburke_at_redhat.com>
Date: Fri, 02 Nov 2012 11:06:39 -0400

On 11/2/2012 10:28 AM, Marek Potociar wrote:
> Bill,
>
> You lost me.
>

Eh, maybe some of my ideas aren't that thought out, but.... Consider
this scenario:

what do you do when there is response filter/interceptor/MBR failures? i.e.

Order order = target.request().post(Order.class, entity);

What if the server returns 200, and a response filter, interceptor or
MBR fails? The client app might want to know a 200 was sent back. As,
server-side, the operation is still successful.

So don't we need an exception like this?

// thrown if response filter or MBR or interceptor fails
class ResponseProcessingException extends ClientException {

     Response getResponse() {...}
}

readEntity() should probably still throw MessageProcessingException

Might also want to have:

// can't send request because of bad IP address, can't connect, etc...
class ClientConnectionFailure extends ClientException {}

// thrown if socket times out on a request
class ClientTimeout extends ClientException {}


-- 
Bill Burke
JBoss, a division of Red Hat
http://bill.burkecentral.com