Display generic error with clean formatting.
(display: DisplayManager, template_id: str, error: Exception)
| 460 | |
| 461 | |
| 462 | def _display_generic_error(display: DisplayManager, template_id: str, error: Exception) -> None: |
| 463 | """Display generic error with clean formatting.""" |
| 464 | display.text("") |
| 465 | display.text("─" * 80, style="dim") |
| 466 | display.text("") |
| 467 | |
| 468 | # Truncate long error messages |
| 469 | max_error_length = 100 |
| 470 | error_msg = str(error) |
| 471 | if len(error_msg) > max_error_length: |
| 472 | error_msg = f"{error_msg[:max_error_length]}..." |
| 473 | |
| 474 | # Display error with details |
| 475 | display.error(f"Failed to generate boilerplate from template '{template_id}'", details=error_msg) |
| 476 | |
| 477 | |
| 478 | def generate_template(module_instance, config: GenerationConfig) -> None: # noqa: PLR0912, PLR0915 |
no test coverage detected