MCPcopy
hub / github.com/zer0yu/CyberSecurityRSS / classify_http_error

Function classify_http_error

scripts/opml_sync.py:178–182  ·  view source on GitHub ↗
(code: int)

Source from the content-addressed store, hash-verified

176
177
178def classify_http_error(code: int) -> FeedCheckResult:
179 if code in {404, 410}:
180 return FeedCheckResult(alive=False, kind="hard_fail", reason=f"http_{code}", status_code=code)
181 # Treat most HTTP errors as transient to reduce false deletions (WAF/rate-limit/geo blocks).
182 return FeedCheckResult(alive=False, kind="transient_fail", reason=f"http_{code}", status_code=code)
183
184
185def coerce_check_result(result: Any) -> FeedCheckResult:

Callers 1

__call__Method · 0.85

Calls 1

FeedCheckResultClass · 0.85

Tested by

no test coverage detected