Save an error block to the collection. Args: job_name: Name of the job lines: Error context lines is_critical: Whether this is a critical error or just a warning
(
self, job_name: str, lines: list[str], is_critical: bool = True
)
| 406 | print(f"\nError analyzing logs: {e}", file=sys.stderr) |
| 407 | |
| 408 | def _save_error_block( |
| 409 | self, job_name: str, lines: list[str], is_critical: bool = True |
| 410 | ) -> None: |
| 411 | """Save an error block to the collection. |
| 412 | |
| 413 | Args: |
| 414 | job_name: Name of the job |
| 415 | lines: Error context lines |
| 416 | is_critical: Whether this is a critical error or just a warning |
| 417 | """ |
| 418 | error_block = { |
| 419 | "job": job_name, |
| 420 | "content": "\n".join(lines), |
| 421 | } |
| 422 | |
| 423 | if is_critical: |
| 424 | self.critical_errors.append(error_block) |
| 425 | else: |
| 426 | self.warnings.append(error_block) |
| 427 | |
| 428 | def print_summary(self) -> None: |
| 429 | """Print summary of errors found.""" |