fix: enhance error logging with exception info across multiple modules

This commit is contained in:
Alex
2025-05-05 13:12:39 +01:00
parent cf333873fd
commit 481df4d604
14 changed files with 37 additions and 30 deletions

View File

@@ -1,3 +1,4 @@
import logging
import requests
import re # Import regular expression library
import xml.etree.ElementTree as ET
@@ -32,7 +33,7 @@ class SitemapLoader(BaseRemote):
documents.extend(loader.load())
processed_urls += 1 # Increment the counter after processing each URL
except Exception as e:
print(f"Error processing URL {url}: {e}")
logging.error(f"Error processing URL {url}: {e}", exc_info=True)
continue
return documents