fix(api): report a response body that ended early as a retryable NETWORK_ERROR

This commit is contained in:
imSp4rky
2026-12-05 00:59:27 -07:00
parent deb4b7846d
commit 96e4a314fb
3 changed files with 55 additions and 3 deletions
+2 -2
View File
@@ -148,7 +148,7 @@ while the server restarts.
| `INTERNAL_ERROR` | 422 | An unexpected server-side error. This is the fallback for any exception the server could not categorise, and for an exception that no handler caught. |
| `DOWNLOAD_ERROR` | 422 | The download process itself failed. |
| `WORKER_ERROR` | 422 | The download worker subprocess errored out. |
| `NETWORK_ERROR` | 424 | A network connectivity problem (connection, timeout, DNS, TLS). Retryable. |
| `NETWORK_ERROR` | 424 | A network connectivity problem (connection, timeout, DNS, TLS, or a response body that ended early). Retryable. |
| `SERVICE_UNAVAILABLE` | 424 | The service is temporarily unavailable or under maintenance. Retryable. |
!!! note "Fallback status"
@@ -180,7 +180,7 @@ exception that is not an `APIError` bubbles up, the server gives it a code in tw
| `geofence`, `geoblock`, `geo-block`, `geolocation`, `region`, `not available in`, `territory` | `GEOFENCE` (403) | no |
| `proxy` | `INVALID_PROXY` (400) | no |
| `auth`, `login`, `credential`, `unauthorized`, `forbidden`, `token` | `AUTH_FAILED` (401) | no |
| `connection`, `timeout`, `network`, `unreachable`, `socket`, `dns`, `resolve` (or `ConnectionError`, `TimeoutError`, `URLError`, `SSLError`) | `NETWORK_ERROR` (424) | yes |
| `connection`, `timeout`, `network`, `unreachable`, `socket`, `dns`, `resolve`, `incompletebody`, `unexpectedeof` (or `ConnectionError`, `TimeoutError`, `URLError`, `SSLError`, `BodyError`) | `NETWORK_ERROR` (424) | yes |
| `not found`, `404`, `does not exist`, `invalid id` | `NOT_FOUND` (404) | no |
| `rate limit`, `too many requests`, `429`, `throttle` | `RATE_LIMITED` (429) | yes |
| `drm`, `license`, `widevine`, `playready`, `decrypt` | `DRM_ERROR` (422) | no |