Sync from dev @ 497baf0
Source: main (497baf0) Excluded: live tenant exports, generated artifacts, and dev-only tooling.
This commit is contained in:
@@ -114,6 +114,15 @@ def request_json(
|
||||
except urllib.error.HTTPError as exc:
|
||||
last_error = exc
|
||||
if exc.code not in retry_codes or attempt == max_retries:
|
||||
body = ""
|
||||
try:
|
||||
body = exc.read().decode("utf-8", errors="replace")[:2048]
|
||||
except Exception:
|
||||
pass
|
||||
if body:
|
||||
raise RuntimeError(
|
||||
f"{method} {url} failed: HTTP Error {exc.code}: {exc.reason} — {body}"
|
||||
) from exc
|
||||
raise
|
||||
retry_after = _get_retry_after_seconds(exc)
|
||||
sleep = retry_after if retry_after is not None else (2 ** attempt)
|
||||
|
||||
Reference in New Issue
Block a user