At one time, I thought we needed that too.  We ended up building our WebApplicationException differently.

When we had an error, we threw the Exception like this (in your case message would be "User ID must be a 24-bit base64 encoded value").
throw new WebApplicationException( Response.status( Status.NOT_ACCEPTABLE ).tag( "text/plain" ).entity( message ).build() );

On the client side, here's how we read it:
// were we given an HTTP error status?
if ( response.getStatusLine().getStatusCode() >= 400 ) {


// read the response content
BufferedReader br = new BufferedReader( new InputStreamReader( response.getEntity().getContent() ) );
StringBuilder sb = new StringBuilder( 100 );
for ( String line = br.readLine(); line != null; line = br.readLine() ) sb.append( line );
br.close();


// throw an exception with the content from the HTTP response
throw new Exception( new String( sb ) );
}

That StringBuilder would contain your error message text.

Cheers,
-Brian

On Feb 7, 2012, at 6:08 AM, Thomas Vestergaard wrote:

Hi,
 
This might not be a significant issue on the server side, but for providing meaningful logging on the client side, it would be immensely helpful to get the reason phrase from the HTTP header rather than using a hard-coded value based on the status code.
 
E,g, Server returns “HTTP/1.1 400 User ID must be a 24-bit base64 encoded value”, then I would like to put this message into the error-log, rather than “Bad Request” – and similarly, when we get a 500.