Print a formatted error message for debugging. Parameters ---------- url : str The URL associated with the query that caused the error. exc : Exception The exception raised during the query or process. max_file_size : int The maximum file size allowed for
(url: str, exc: Exception, max_file_size: int, pattern_type: str, pattern: str)
| 371 | |
| 372 | |
| 373 | def _print_error(url: str, exc: Exception, max_file_size: int, pattern_type: str, pattern: str) -> None: |
| 374 | """Print a formatted error message for debugging. |
| 375 | |
| 376 | Parameters |
| 377 | ---------- |
| 378 | url : str |
| 379 | The URL associated with the query that caused the error. |
| 380 | exc : Exception |
| 381 | The exception raised during the query or process. |
| 382 | max_file_size : int |
| 383 | The maximum file size allowed for the query, in bytes. |
| 384 | pattern_type : str |
| 385 | Specifies the type of pattern to use, either "include" or "exclude". |
| 386 | pattern : str |
| 387 | The actual pattern string to include or exclude in the query. |
| 388 | |
| 389 | """ |
| 390 | logger.error( |
| 391 | "Query processing failed", |
| 392 | extra={ |
| 393 | "url": url, |
| 394 | "max_file_size_kb": int(max_file_size / 1024), |
| 395 | "pattern_type": pattern_type, |
| 396 | "pattern": pattern, |
| 397 | "error": str(exc), |
| 398 | }, |
| 399 | ) |
| 400 | |
| 401 | |
| 402 | def _print_success(url: str, max_file_size: int, pattern_type: str, pattern: str, summary: str) -> None: |