Print error banner with optional recommendations. Example output: ❌ Package installation FAILED ────────────────────────────────────────────────────────── Error: Installation already in progress Active installation: └─ PID: 49428
(
title: str, error_message: str, recommendations: list[str] | None = None
)
| 135 | |
| 136 | @staticmethod |
| 137 | def print_error_banner( |
| 138 | title: str, error_message: str, recommendations: list[str] | None = None |
| 139 | ) -> None: |
| 140 | """Print error banner with optional recommendations. |
| 141 | |
| 142 | Example output: |
| 143 | ❌ Package installation FAILED |
| 144 | ────────────────────────────────────────────────────────── |
| 145 | Error: Installation already in progress |
| 146 | Active installation: |
| 147 | └─ PID: 49428 |
| 148 | └─ CWD: C:\\Users\\...\\examples\\Blink |
| 149 | |
| 150 | Recommended actions: |
| 151 | 1. Wait for active installation to complete, then retry |
| 152 | 2. Check daemon status: uv run python ci/util/pio_package_client.py --status |
| 153 | ────────────────────────────────────────────────────────── |
| 154 | |
| 155 | Args: |
| 156 | title: Error title |
| 157 | error_message: Detailed error message |
| 158 | recommendations: Optional list of recommended actions |
| 159 | """ |
| 160 | separator = BannerPrinter.SINGLE_LINE * BannerPrinter.BANNER_WIDTH |
| 161 | |
| 162 | print(f"\n❌ {title}") |
| 163 | print(separator) |
| 164 | print(f"Error: {error_message}") |
| 165 | |
| 166 | if recommendations: |
| 167 | print("\nRecommended actions:") |
| 168 | for i, rec in enumerate(recommendations, 1): |
| 169 | print(f" {i}. {rec}") |
| 170 | |
| 171 | print(separator) |
| 172 | print() |
| 173 | |
| 174 | @staticmethod |
| 175 | def format_elapsed_time(seconds: float) -> str: |
no test coverage detected