docs: better message for download extensions (#18606)

This commit is contained in:
Jirka Borovec 2023-09-21 12:36:15 +02:00 committed by GitHub
parent 3e2cd24a3d
commit 18c80d2471
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 1 deletions

View File

@ -450,7 +450,10 @@ class AssistantCLI:
with tempfile.TemporaryDirectory() as tmp:
zip_file = os.path.join(tmp, "repo.zip")
urllib.request.urlretrieve(zip_url, zip_file)
try:
urllib.request.urlretrieve(zip_url, zip_file)
except urllib.error.HTTPError:
raise urllib.error.HTTPError(f"Requesting file '{zip_url}' does not exist or it is just unavailable.")
with zipfile.ZipFile(zip_file, "r") as zip_ref:
zip_ref.extractall(tmp)