Skip to content

[CLI] No traceback on LocalEntryNotFoundError#4190

Merged
hanouticelina merged 3 commits into
mainfrom
no-traceback-on-local-entry-not-found
May 12, 2026
Merged

[CLI] No traceback on LocalEntryNotFoundError#4190
hanouticelina merged 3 commits into
mainfrom
no-traceback-on-local-entry-not-found

Conversation

@Wauplin

@Wauplin Wauplin commented May 5, 2026

Copy link
Copy Markdown
Collaborator

With this PR:

$ HF_HUB_OFFLINE=1 hf download gpt2 config.json
Error: Local entry not found. Cannot reach https://huggingface.co/gpt2/resolve/main/config.json: offline mode is enabled. To disable it, please unset the `HF_HUB_OFFLINE` environment variable.
Set HF_DEBUG=1 as environment variable for full traceback.

cc @julien-c


Note

Low Risk
Low risk: changes are limited to CLI exception-to-message formatting and should not affect core download behavior. Main risk is minor messaging/regression in which exception gets matched/printed for offline/local-cache error cases.

Overview
Improves CLI error formatting for offline/local-cache download scenarios by handling LocalEntryNotFoundError explicitly and printing a concise message (preferring the underlying __cause__) instead of a traceback.

Adds OfflineModeIsEnabled to the known-exception mapping so offline-mode errors also render cleanly via format_known_exception.

Reviewed by Cursor Bugbot for commit bb70288. Bugbot is set up for automated code reviews on this repo. Configure here.

@Wauplin Wauplin requested a review from julien-c May 5, 2026 13:13
@bot-ci-comment

bot-ci-comment Bot commented May 5, 2026

Copy link
Copy Markdown

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

@hanouticelina hanouticelina left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@hanouticelina hanouticelina merged commit 230c624 into main May 12, 2026
20 checks passed
@hanouticelina hanouticelina deleted the no-traceback-on-local-entry-not-found branch May 12, 2026 17:10
@huggingface-hub-bot

Copy link
Copy Markdown
Contributor

This PR has been shipped as part of the v1.15.0 release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants