MultiPage.this.fetchState = null;
} else {
logger.error("Received unknown result type '{}' during paging: ignoring message", rm.kind);
// This mean we have probably have a bad node, so defunct the connection
connection.defunct(new ConnectionException(connection.address, String.format("Got unexpected %s result response", rm.kind)));
future.setException(new DriverInternalError(String.format("Got unexpected %s result response from %s", rm.kind, connection.address)));
return;
}
MultiPage.this.infos.offer(info);
future.set(null);
break;
case ERROR:
future.setException(((Responses.Error)response).asException(connection.address));
break;
default:
// This mean we have probably have a bad node, so defunct the connection
connection.defunct(new ConnectionException(connection.address, String.format("Got unexpected %s response", response.type)));
future.setException(new DriverInternalError(String.format("Got unexpected %s response from %s", response.type, connection.address)));
break;
}
} catch (RuntimeException e) {
// If we get a bug here, the client will not get it, so better forwarding the error
future.setException(new DriverInternalError("Unexpected error while processing response from " + connection.address, e));
}
}
// This is only called for internal calls, so don't bother with ExecutionInfo
@Override