INNER CODE UNIT · Python

handle_error

nolabs-ai/deepfabric · deepfabric/cli.py:56

def handle_error(ctx: click.Context, error: Exception) -> NoReturn:
    """Handle errors in CLI commands."""
    _ = ctx  # Unused but required for click context
    tui = get_tui()

    # Check if this is formatted error from our event handlers
    error_msg = str(error)
    if not error_msg.startswith("Error: "):
        tui.error(f"Error: {error_msg}")
    else:
        tui.error(error_msg)

    sys.exit(1)


def _get_checkpoint_topics_path(
    checkpoint_dir: str,
    output_save_as: str,

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…