I am creating a client that consumes an API with WebTarget, taking a closer look into javax.ws.rs.core.Response, javax.ws.rs.core.Response.Status and javax.ws.rs.ClientErrorException, I did not found a UNPROCESSABLE ENTITY (422) status, further I did not found a subclass for ClientErrorException what would specialise this response.
Then, my question is: performing a get() of SyncInvoker, which gives me a Response, what probably will be the status? What would be an appropriate exception to throw in this case? Assuming that I will throw an execption in case of the status of the request to the upstream api to be other than 200. For instance, BadRequestException for 400, NotAuthorizedException for 401, ForbiddenException for 403, and so forth.