1 parent a859e12 commit 9d6af3bCopy full SHA for 9d6af3b
1 file changed
src/herbie/experimental/download.py
@@ -85,8 +85,17 @@ def _download_remote_byte_range(
85
response.raise_for_status()
86
87
if response.status_code != 206:
88
- raise Exception(
89
- f"Server doesn't support range requests (status: {response.status_code})"
+ content_length = response.headers.get("Content-Length", "unknown")
+ response.close()
90
+ raise RuntimeError(
91
+ f"Range request not honored: server returned "
92
+ f"HTTP {response.status_code} "
93
+ f"(Content-Length: {content_length}). "
94
+ f"This can happen when a network proxy or "
95
+ f"VPN strips the Range header. Try downloading "
96
+ f"the full file first, then subset locally:\n"
97
+ f" full_file = Herbie(...).download()\n"
98
+ f" Herbie(...).download(search=...)"
99
)
100
101
with open(temp_file, "wb") as f:
0 commit comments