MCPcopy
hub / github.com/ChristianLempa/boilerplates / _display_generic_error

Function _display_generic_error

cli/core/module/base_commands.py:462–475  ·  view source on GitHub ↗

Display generic error with clean formatting.

(display: DisplayManager, template_id: str, error: Exception)

Source from the content-addressed store, hash-verified

460
461
462def _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
478def generate_template(module_instance, config: GenerationConfig) -> None: # noqa: PLR0912, PLR0915

Callers 1

generate_templateFunction · 0.85

Calls 2

textMethod · 0.45
errorMethod · 0.45

Tested by

no test coverage detected