fix: Handle failed status requests in SABnzbd check_connected
Summary
Mirrors the qBit fix from #342 (just approved) for the same bug class in SABnzbd.
Previously, an HTTP error from SABnzbd's status endpoint (e.g. a 500) would raise out of make_request and crash decluttarr entirely. Now the error is caught and treated as a disconnected client, so the cycle is skipped and retried next run.
Before: SAB returns 500 → HTTPError propagates up through check_connected → _check_client_connection_status → _download_clients_connected → removal_jobs → run_jobs → main → process exits, container restart-loops.
After: SAB returns 500 → caught locally → warning logged → False returned → that client is skipped this cycle, other clients/instances continue, next cycle retries.
Same shape as #342 — granular per-client handling, not a broad top-level catch.
Test plan
Smoke tested four paths against the patched check_connected:
- [x] HTTPError (500) → returns
False, warning logged, no crash - [x] Connected (
{"status": True}) → returnsTrue - [x] Missing
statuskey → returnsFalse - [x] Invalid JSON (
response.json()raises) → returnsFalse
Full test suite: 198/198 passing.
Notes
- No new tests added — there's no existing coverage for
check_connectedin either qbit or sabnzbd, so this stays consistent with the codebase. Happy to add tests for both if preferred. - Targets
devfor consistency with #342.
🤖 Generated with Claude Code