Custom Jersey Error Handling, how to catch response at client side?
I'm trying out some custom error handling on my webservice. In my webservice, I created a custom Exception class extending WebApplicationException as described in JAX-RS / Jersey how to customize error handling? : public class InternalServerErrorException extends WebApplicationException { public InternalServerErrorException(String message) { super(Response.status(Response.Status.INTERNAL_SERVER_ERROR) .header("errorMessage", message).type(MediaType.TEXT_PLAIN).build()); System.out.println(message); } } For testing, I have a simple Country service that gives a list of countries. I made sure