The InvalidApiKeyException is thrown on any client request when the
Orchestrate Api Key is invalid. For example, calling the (blocking)
ping() method on client:
try {
client.ping();
} catch (InvalidApiKeyException ex) {
//do something with invalid Api Key failures
}
Or, via a blocking get()
try {
client.kv("collection", "key")
.get(String.class)
.get();
} catch (InvalidApiKeyException ex) {
//do something with invalid Api Key failures
}
Any Listeners attached for asynchronous handling will be failed and
the 'onFailure' method will be called with the InvalidApiKeyException:
client.kv("collection", "key")
.get(String.class)
.on(new ResponseListener<KvObject<String>>() {
public void onFailure(Throwable failure) {
if (failure instanceof InvalidApiKeyException) {
//do something with invalid Api Key failures
}
}
public void onSuccess(KvObject<String> object) {
}
});