mirror of
https://github.com/4gray/iptvnator.git
synced 2026-10-08 17:06:15 -08:00
Greptile and Codex both flagged the same hole in the sweep's error handling: `gh api` exits 1 for every failure alike, so a rate limit, permission loss or outage that hit the DELETE would hit the follow-up GET too — and the GET's nonzero exit was read as proof the draft was already gone. `failed` stayed 0 and the sweep went green over a draft it never deleted. Read the response status instead of the exit code. `gh api -i` prints the status line even for an error status, so a genuine 404 (the event job racing the sweep to the same draft) is distinguishable from everything else; a request that never got a response leaves the status empty, which is not 404 and so stays a failure. Verified against the live API: a deleted release re-checks as 404 and is excused, an existing release re-checks as 200 and fails the job, and an unreachable host yields no status and fails the job. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>