[jax-rs-spec users] [jsr339-experts] Exception getMessage() on the client side

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


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