fix(cookbook): resolve NameError in hf-gguf-files exception handler (#6341) (#6369)

In routes/cookbook_routes.py, the exception handler for GET /api/cookbook/hf-gguf-files referenced repo instead of the parameter repo_id, causing an unhandled NameError and 500 status when upstream requests to Hugging Face failed.

Fixes #6341.
This commit is contained in:
Aashish Mahato
2026-10-31 12:59:17 +00:00
committed by GitHub
parent bebf53be3c
commit 9a1fdb192e
2 changed files with 63 additions and 1 deletions
+1 -1
View File
@@ -3930,7 +3930,7 @@ def setup_cookbook_routes() -> APIRouter:
return {"ok": False, "files": [], "error": f"HF API HTTP {resp.status_code}"}
data = resp.json()
except Exception:
logger.exception("HF GGUF file scan failed for %s", repo)
logger.exception("HF GGUF file scan failed for %s", repo_id)
return {"ok": False, "files": [], "error": "HF API request failed"}
files = [
str(s.get("rfilename") or "")