From 023c544783db108cd6ca3e0f17b4f83356202c2f Mon Sep 17 00:00:00 2001 From: Alfredo Ramos Date: Tue, 10 Feb 2026 12:33:59 -0500 Subject: [PATCH] fix: prevent _ensure_hf_token from swallowing click.Abort The broad `except Exception` handler was catching `click.Abort`, turning an intentional abort into a misleading warning with an empty message and allowing execution to continue. Closes #936 Co-Authored-By: Claude Opus 4.6 --- clarifai/cli/model.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/clarifai/cli/model.py b/clarifai/cli/model.py index 5d6033ec..4e7ac049 100644 --- a/clarifai/cli/model.py +++ b/clarifai/cli/model.py @@ -884,6 +884,8 @@ def _ensure_hf_token(ctx, model_path): if 'checkpoints' not in config: config['checkpoints'] = {} config["checkpoints"]["hf_token"] = hf_token + except click.Abort: + raise except Exception as e: logger.warning(f"Unexpected error ensuring HF_TOKEN: {e}")