Skip to content

update "unsupported registry index name" error message to provide additional useful information #234

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 27, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions src/main/java/gov/nasa/pds/harvest/cfg/ConfigManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,11 @@ static public List<String> exchangeLidvids (List<CollectionType> ids) {
return lidvids;
}
static public String exchangeIndexForNode (String indexName) {
if (indexNodeMap.containsKey (indexName)) return indexNodeMap.get(indexName);
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");
if (!indexNodeMap.containsKey (indexName)) {
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");
}

return indexNodeMap.get(indexName);
}
static public ConnectionFactory exchangeRegistry (RegistryType xml) throws Exception {
return EstablishConnectionFactory.from (xml.getValue(), xml.getAuth());
Expand Down