Print a formatted error message to the console. Args: message: The main error message details: Optional details about the error suggestion: Optional suggestion for resolving the error
(message: str, details: Optional[str] = None, suggestion: Optional[str] = None)
| 42 | } |
| 43 | |
| 44 | def print_error(message: str, details: Optional[str] = None, suggestion: Optional[str] = None) -> None: |
| 45 | """ |
| 46 | Print a formatted error message to the console. |
| 47 | |
| 48 | Args: |
| 49 | message: The main error message |
| 50 | details: Optional details about the error |
| 51 | suggestion: Optional suggestion for resolving the error |
| 52 | """ |
| 53 | print(f"{COLORS['red']}{COLORS['bold']}ERROR: {message}{COLORS['reset']}") |
| 54 | if details: |
| 55 | print(f"{details}") |
| 56 | if suggestion: |
| 57 | print(f"\n{COLORS['yellow']}SUGGESTION: {suggestion}{COLORS['reset']}") |
| 58 | |
| 59 | def handle_cli_error(error: Exception) -> int: |
| 60 | """ |
no outgoing calls
no test coverage detected