SERPent / utils.py
Claude
Fix bare except and misattributed logger (item 3 from review)
21042c7 unverified
Raw History Blame
388 Bytes
import logging
from serp import SerpQuery
logger = logging.getLogger(__name__)
def log_gathered_exceptions(results: list, context: str, params: SerpQuery):
"""Logs gathered exceptions with context and parameters."""
for exc, q in zip(results, params.queries):
if isinstance(exc, Exception):
logger.warning(f"Error during {context} for query '{q}': {exc}")