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

[jsr339-experts] Exception getMessage() on the client side

From: Sergey Beryozkin <sberyozkin_at_talend.com>
Date: Tue, 4 Sep 2012 13:30:29 +0100

Hi

Suppose we have a server returning 500 and also choosing to add some
text in the response body.

We can write:

catch (ServerErrorException ex) {

    String errorMessage = ex.getResponse().readEntity(String.class);

}

Would it make sense to request that

ex.getMessage() is equivalent to ex.getResponse().readEntity(String.class);

?

Cheers, Sergey