Skip to content

Commit 8ee2e5f

Browse files
authored
Merge pull request #234 from NASA-PDS/exception-improvement
update "unsupported registry index name" error message to provide additional useful information
2 parents 4ba770d + 2fe4173 commit 8ee2e5f

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/main/java/gov/nasa/pds/harvest/cfg/ConfigManager.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,11 @@ static public List<String> exchangeLidvids (List<CollectionType> ids) {
5959
return lidvids;
6060
}
6161
static public String exchangeIndexForNode (String indexName) {
62-
if (indexNodeMap.containsKey (indexName)) return indexNodeMap.get(indexName);
63-
throw new IllegalArgumentException("Index (" + indexName + ") + not supported: either fix it in your configuration by using one of the supported or request an upgrade of harvest to support your new index by submitting a ticket on https://github.com/NASA-PDS/harvest/issues");
62+
if (!indexNodeMap.containsKey (indexName)) {
63+
throw new IllegalArgumentException("Index \"" + indexName + "\" is not one of the supported indices (\"" + String.join("\", \"", indexNodeMap.keySet()) + "\"): use a supported index name in your configuration or request that index \"" + indexName + "\" be added to harvest by submitting a ticket on https://github.com/NASA-PDS/harvest/issues");
64+
}
65+
66+
return indexNodeMap.get(indexName);
6467
}
6568
static public ConnectionFactory exchangeRegistry (RegistryType xml) throws Exception {
6669
return EstablishConnectionFactory.from (xml.getValue(), xml.getAuth());

0 commit comments

Comments
 (0)