fix(docker): catch JSONDecodeError when querying Docker Hub tags

Non-JSON Hub responses (block pages, 5xx HTML) would bypass URLError
handling and crash json.load; surface them as RuntimeError instead.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
suluyan
2026-07-20 19:25:41 +08:00
parent 780a3e9c5e
commit 7446bf2222

View File

@@ -516,7 +516,7 @@ class AmdImageBuilder(Builder):
try:
with urllib.request.urlopen(req, timeout=60) as resp:
payload = json.load(resp)
except urllib.error.URLError as exc:
except (urllib.error.URLError, json.JSONDecodeError) as exc:
raise RuntimeError(
f'Failed to query Docker Hub tags for {VLLM_ROCM_REPO}: '
f'{exc}') from exc