Catch exceptions and inform handler in RemoteClusterConnection#collectNodes
This adds a missing catch block to invoke the action listener instead of bubbeling
up the exception.
Closes
@@ -230,6 +230,7 @@ final class RemoteClusterConnection extends AbstractComponent implements Transpo
}
});
};
+ try {
if (connectedNodes.size() == 0) {
// just in case if we are not connected for some reason we try to connect and if we fail we have to notify the listener
// this will cause some back pressure on the search end and eventually will cause rejections but that's fine
@@ -240,6 +241,9 @@ final class RemoteClusterConnection extends AbstractComponent implements Transpo
} else {
runnable.run();
}
+ } catch (Exception ex) {
+ listener.onFailure(ex);
+ }
}
/**
