jsr339-experts@jax-rs-spec.java.net

[jsr339-experts] client exception processing not what we agreed...

From: Bill Burke <bburke_at_redhat.com>
Date: Fri, 08 Feb 2013 14:41:39 -0500

This is valid JAX-RS 2.0 exception handling correct?

try {
    String result = webTarget.request().get(String.class);
} catch (NotFoundException ex) {
} catch (...) {}

All the WebAplicationException derivatives are thrown from all methods
that don't return Response, correct?


I'm looking at the Javadoc of AsyncInvoker:

      * In case a processing of a properly received response fails, the
wrapped processing exception
      * will be of {_at_link ResponseProcessingException} type and will
contain the {_at_link Response}
      * instance whose processing has failed.

It doesn't seem like this is the same for async invocations, which I
think it wrong. Async invocations should also be similar to sync.

Future<String> future = webTarget.request().async().get(String.class);

try {
    String result = future.get();
} catch (NotFoundException ex) {
} catch (...) {...}

It sounds like from the javadoc that everything is wrapped within a
ResponseProcessingException.


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