mirror of
https://github.com/MarginaliaSearch/MarginaliaSearch.git
synced 2025-02-23 13:09:00 +00:00
(crawler) Reduce log spam from error handling in new sitemap fetcher
This commit is contained in:
parent
2c67f50a43
commit
579a115243
@ -297,7 +297,7 @@ public class HttpFetcherImpl implements HttpFetcher {
|
||||
return ret;
|
||||
}
|
||||
catch (Exception ex) {
|
||||
logger.error("Error while fetching sitemaps via " + root, ex);
|
||||
logger.error("Error while fetching sitemaps via {}: {} ({})", root, ex.getClass().getSimpleName(), ex.getMessage());
|
||||
return List.of();
|
||||
}
|
||||
}
|
||||
@ -329,6 +329,10 @@ public class HttpFetcherImpl implements HttpFetcher {
|
||||
}
|
||||
|
||||
Document parsedSitemap = Jsoup.parse(parserStream, "UTF-8", sitemapUrl.toString(), Parser.xmlParser());
|
||||
if (parsedSitemap.childrenSize() == 0) {
|
||||
return new SitemapResult.SitemapError();
|
||||
}
|
||||
|
||||
String rootTagName = parsedSitemap.child(0).tagName();
|
||||
|
||||
return switch (rootTagName.toLowerCase()) {
|
||||
|
Loading…
Reference in New Issue
Block a user