Don't fail on invalid seed URLs, just warn the error (closes
@@ -184,6 +184,7 @@ public class FrontierManager {
public void addSeeds(String[] seeds) {
if (seeds != null && seeds.length > 0) {
int count = 0;
+ int errors = 0;
logger.info("Adding {} seed URL(s)...", seeds.length);
for (String seed : seeds) {
@@ -191,7 +192,9 @@ public class FrontierManager {
try {
seedUrl = new URL(seed);
} catch (MalformedURLException e) {
- throw new IllegalArgumentException("Invalid seed URL provided: " + seed, e);
+ logger.warn("Invalid seed URL provided: " + seed);
+ errors++;
+ continue;
}
LinkRelevance link = new LinkRelevance(seedUrl, LinkRelevance.DEFAULT_RELEVANCE);
try {
@@ -205,6 +208,9 @@ public class FrontierManager {
}
}
logger.info("Number of seeds added: " + count);
+ if (errors > 0) {
+ logger.info("Number of invalid seeds: " + errors);
+ }
}
}
