Functions
handle_cli_errors
Decorator for unified CLI error handling.
handle_cli_errors
def handle_cli_errors(show_art: bool = False, preserve_chain: bool = True, show_traceback: bool | None = None) -> Callable[[F], F]
Decorator for unified CLI error handling.
Parameters 3
| Name | Type | Default | Description |
|---|---|---|---|
show_art |
bool |
False |
Whether to show ASCII art in error messages |
preserve_chain |
bool |
True |
Whether to preserve exception chain (raise ... from e) |
show_traceback |
bool | None |
None |
Whether to show traceback (None = auto-detect from config) |
Returns
Callable[[F], F]
cli_error_context
Context manager for error handling within command functions.
cli_error_context
def cli_error_context(operation: str, show_art: bool = False, show_traceback: bool | None = None) -> Generator[None]
Context manager for error handling within command functions.
Parameters 3
| Name | Type | Default | Description |
|---|---|---|---|
operation |
str |
— | Description of the operation being performed |
show_art |
bool |
False |
Whether to show ASCII art in error messages |
show_traceback |
bool | None |
None |
Whether to show traceback (None = auto-detect) |
Returns
Generator[None]