Code cleanup and improvements.

This commit is contained in:
2026-09-03 21:52:06 +02:00
parent ea323e3ab0
commit ecdea827ac
20 changed files with 312 additions and 213 deletions

View File

@@ -782,13 +782,15 @@ class DepotClient:
try:
response = self._opener(request, timeout=self.timeout_seconds)
except HTTPError as exc:
if exc.code == 416 and requested_offset:
status = exc.code
exc.close()
if status == 416 and requested_offset:
raise _RetryableDownloadError(
f"server rejected the saved offset for {file.path}",
discard_partial=True,
) from exc
raise _RetryableDownloadError(
f"HTTP {exc.code} from {server} for {file.path}"
f"HTTP {status} from {server} for {file.path}"
) from exc
except (OSError, HTTPException) as exc:
raise _RetryableDownloadError(