protected RuntimeException convertException(EmoClientException e) { EmoResponse response = e.getResponse(); String exceptionType = response.getFirstHeader("X-BV-Exception"); if (response.getStatus() == Response.Status.BAD_REQUEST.getStatusCode() && IllegalArgumentException.class.getName().equals(exceptionType)) { return new IllegalArgumentException(response.getEntity(String.class), e); } else if (response.getStatus() == Response.Status.NOT_FOUND.getStatusCode() && UnknownMoveException.class.getName().equals(exceptionType)) { return response.getEntity(UnknownMoveException.class); } else if (response.getStatus() == Response.Status.FORBIDDEN.getStatusCode() && UnauthorizedException.class.getName().equals(exceptionType)) { if (response.hasEntity()) { return (RuntimeException) response.getEntity(UnauthorizedException.class).initCause(e); } else { return (RuntimeException) new UnauthorizedException().initCause(e); } } else if (response.getStatus() == Response.Status.SERVICE_UNAVAILABLE.getStatusCode() && ServiceUnavailableException.class.getName().equals(exceptionType)) { if (response.hasEntity()) { return (RuntimeException) response.getEntity(ServiceUnavailableException.class).initCause(e); } else { return (RuntimeException) new ServiceUnavailableException().initCause(e); } } return e; }
if (response.hasEntity()) { return (RuntimeException) response.getEntity(UnknownSubscriptionException.class).initCause(e); } else { } else if (response.getStatus() == Response.Status.FORBIDDEN.getStatusCode() && UnauthorizedSubscriptionException.class.getName().equals(exceptionType)) { if (response.hasEntity()) { return (RuntimeException) response.getEntity(UnauthorizedSubscriptionException.class).initCause(e); } else { if (response.hasEntity()) { return (RuntimeException) response.getEntity(UnauthorizedException.class).initCause(e); } else { if (response.hasEntity()) { return (RuntimeException) response.getEntity(ServiceUnavailableException.class).initCause(e); } else {
if (response.hasEntity()) { return (RuntimeException) response.getEntity(TableExistsException.class).initCause(e); } else { if (response.hasEntity()) { return (RuntimeException) response.getEntity(UnknownTableException.class).initCause(e); } else { if (response.hasEntity()) { return (RuntimeException) response.getEntity(UnknownPlacementException.class).initCause(e); } else { if (response.hasEntity()) { return (RuntimeException) response.getEntity(StashNotAvailableException.class).initCause(e); } else { if (response.hasEntity()) { return (RuntimeException) response.getEntity(UnauthorizedException.class).initCause(e); } else { if (response.hasEntity()) { return (RuntimeException) response.getEntity(ServiceUnavailableException.class).initCause(e); } else {
if (response.hasEntity()) { return (RuntimeException) response.getEntity(TableExistsException.class).initCause(e); } else { if (response.hasEntity()) { return (RuntimeException) response.getEntity(UnknownTableException.class).initCause(e); } else { if (response.hasEntity()) { return (RuntimeException) response.getEntity(BlobNotFoundException.class).initCause(e); } else { if (response.hasEntity()) { return (RuntimeException) response.getEntity(UnknownPlacementException.class).initCause(e); } else { if (response.hasEntity()) { return (RuntimeException) response.getEntity(RangeNotSatisfiableException.class).initCause(e); } else { if (response.hasEntity()) { return (RuntimeException) response.getEntity(UnauthorizedException.class).initCause(e); } else { if (response.hasEntity()) { return (RuntimeException) response.getEntity(ServiceUnavailableException.class).initCause(e); } else {
if (response.hasEntity()) { return (RuntimeException) response.getEntity(TableExistsException.class).initCause(e); } else { if (response.hasEntity()) { return (RuntimeException) response.getEntity(UnknownTableException.class).initCause(e); } else { if (response.hasEntity()) { return (RuntimeException) response.getEntity(UnknownPlacementException.class).initCause(e); } else { if (response.hasEntity()) { return (RuntimeException) response.getEntity(StashNotAvailableException.class).initCause(e); } else { if (response.hasEntity()) { return (RuntimeException) response.getEntity(UnauthorizedException.class).initCause(e); } else { if (response.hasEntity()) { return (RuntimeException) response.getEntity(ServiceUnavailableException.class).initCause(e); } else {
if (response.hasEntity()) { return (RuntimeException) response.getEntity(TableExistsException.class).initCause(e); } else { if (response.hasEntity()) { return (RuntimeException) response.getEntity(UnknownTableException.class).initCause(e); } else { if (response.hasEntity()) { return (RuntimeException) response.getEntity(BlobNotFoundException.class).initCause(e); } else { if (response.hasEntity()) { return (RuntimeException) response.getEntity(UnknownPlacementException.class).initCause(e); } else { if (response.hasEntity()) { return (RuntimeException) response.getEntity(RangeNotSatisfiableException.class).initCause(e); } else { if (response.hasEntity()) { return (RuntimeException) response.getEntity(UnauthorizedException.class).initCause(e); } else { if (response.hasEntity()) { return (RuntimeException) response.getEntity(ServiceUnavailableException.class).initCause(e); } else {
if (response.hasEntity()) { return (RuntimeException) response.getEntity(InvalidEmoPermissionException.class).initCause(e); } else { if (response.hasEntity()) { return (RuntimeException) response.getEntity(EmoApiKeyExistsException.class).initCause(e); } else { if (response.hasEntity()) { return (RuntimeException) response.getEntity(EmoRoleExistsException.class).initCause(e); } else { if (response.hasEntity()) { return (RuntimeException) response.getEntity(EmoApiKeyNotFoundException.class).initCause(e); } else { if (response.hasEntity()) { return (RuntimeException) response.getEntity(EmoRoleNotFoundException.class).initCause(e); } else { if (response.hasEntity()) { return (RuntimeException) response.getEntity(UnauthorizedException.class).initCause(e); } else { if (response.hasEntity()) { return (RuntimeException) response.getEntity(InsufficientRolePermissionException.class).initCause(e); } else { if (response.hasEntity()) {