// TODO this may be an issue on the Cassandra side which warrants ivestigation.
// I seem to remember these coming back as TimedOutException previously
if ( ((TTransportException)original).getCause() instanceof SocketTimeoutException ) {
return new HTimedOutException(original);
} else {
return new HectorTransportException(original);
}
} else if (original instanceof org.apache.cassandra.thrift.TimedOutException) {
return new HTimedOutException(original);
} else if (original instanceof org.apache.cassandra.thrift.InvalidRequestException) {
// See bug https://issues.apache.org/jira/browse/CASSANDRA-1862
// If a bootstrapping node is accessed it responds with IRE. It makes more sense to throw
// UnavailableException.
// Hector wraps this caveat and fixes this.
String why = ((org.apache.cassandra.thrift.InvalidRequestException) original).getWhy();
if (why != null && why.contains("bootstrap")) {
return new HUnavailableException(original);
}
HInvalidRequestException e = new HInvalidRequestException(original);
e.setWhy(why);
return e;
} else if (original instanceof HPoolExhaustedException ) {
return (HPoolExhaustedException) original;
} else if (original instanceof HPoolRecoverableException ) {
return (HPoolRecoverableException) original;
} else if (original instanceof HInactivePoolException ) {
return (HInactivePoolException) original;
} else if (original instanceof TProtocolException) {
return new HInvalidRequestException(original);
} else if (original instanceof org.apache.cassandra.thrift.NotFoundException) {
return new HNotFoundException(original);
} else if (original instanceof org.apache.cassandra.thrift.UnavailableException) {
return new HUnavailableException(original);
} else if (original instanceof TException) {
return new HectorTransportException(original);
} else if (original instanceof NoSuchElementException) {
return new HPoolExhaustedException(original);
} else if (original instanceof IllegalStateException) {
return new PoolIllegalStateException(original);
} else {