MNT-22817: Fix flow when unable to retrieve node's metadata

(cherry picked from commit 5a03c798091b809a52f7cc27152918ec38cdf42d)
This commit is contained in:
Nicolas Barithel
2022-03-04 12:28:38 +00:00
committed by Vitor Moreira
parent 0ee9497f19
commit a14ac99921
@@ -1719,7 +1719,11 @@ public class SolrInformationServer implements InformationServer
Optional<Collection<NodeMetaData>> nodeMetaDatas = getNodesMetaDataFromRepository(nmdp);
if (nodeMetaDatas.isEmpty() || nodeMetaDatas.get().isEmpty()) return;
if (nodeMetaDatas.isEmpty() || nodeMetaDatas.get().isEmpty())
{
// Using exception for flow handling to jump to error node processing.
throw new Exception("Error loading node metadata from repository.");
}
NodeMetaData nodeMetaData = nodeMetaDatas.get().iterator().next();
if (node.getTxnId() == Long.MAX_VALUE)