Originally created by: TheoV823
scripts/deploy_site.py swallows the Cloudflare API response body when a purge request fails. The except block at lines 78–79 only prints the HTTPError string representation, not the JSON errors[] body returned by Cloudflare. This makes purge failures opaque — the Task 3 HTTP 400 in run 25990885821 required manual log inspection and code reading to diagnose.
Discovered during Task 3 of the post-launch cleanup runbook (2026-05-17). Deploy run 25990885821 logged only:
[WARN] Cloudflare purge error (deploy succeeded): HTTP Error 400: Bad Request
The actual Cloudflare errors[] body was never surfaced, preventing self-diagnosis.
In scripts/deploy_site.py around line 78, change the except block to read and log the response body:
except urllib.error.HTTPError as e:
body = e.read().decode("utf-8", errors="replace")
print(f"[WARN] Cloudflare purge error: {e} — {body}")
This preserves the non-fatal warn-only behaviour while making future failures self-diagnosing.
scripts/deploy_site.pySee also: [#46] (renamed site files in delta deploy) — distinct problem in the same file; keep scopes separate.
Discovered during post-launch cleanup runbook (2026-05-17).