SERPent / utils.py
Game4all's picture
Make scrapping async
66641c2
from asyncio.log import logger
from serp import SerpQuery
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}")