(loader) Fix it so that the loader doesn't explode if it sees an invalid URL

This commit is contained in:
Viktor Lofgren 2024-09-12 11:36:00 +02:00
parent 99523ca079
commit 2a92de29ce

View File

@ -83,9 +83,15 @@ public class DocumentLoaderService {
projection.ordinal()
);
var parsedUrl = EdgeUrl.parse(projection.url());
if (parsedUrl.isEmpty()) {
logger.error("Failed to parse URL: {}", projection.url());
return;
}
documentDbWriter.add(new DocdbUrlDetail(
urlId,
new EdgeUrl(projection.url()),
parsedUrl.get(),
projection.title(),
projection.description(),
projection.quality(),