mirror of
https://github.com/unshackle-dl/unshackle.git
synced 2026-11-12 12:05:07 +00:00
feat(api)!: add a server drain and never answer with a 5xx
POST/DELETE /api/dashboard/drain refuses new sessions and jobs (SERVER_DRAINING, 409) and warns open sessions. A CDN can replace a 5xx body, so server errors are now 422, retryable ones and the tunnel check 424, and a new middleware turns any 5xx into 422. BREAKING CHANGE: INTERNAL_ERROR, DOWNLOAD_ERROR, WORKER_ERROR and the fallback return 422 instead of 500; NETWORK_ERROR and SERVICE_UNAVAILABLE return 424 instead of 503; /api/tunnel/check failures return 424 instead of 502.
This commit is contained in:
@@ -443,8 +443,8 @@ The `error_code` maps to an HTTP status. The ones you will meet most often:
|
||||
| `CONFLICT` | 409 | Illegal state transition (e.g. retry a running job) |
|
||||
| `SERVICE_ERROR` | 422 | The service raised an error |
|
||||
| `RATE_LIMITED` | 429 | Upstream throttling (retryable) |
|
||||
| `INTERNAL_ERROR` | 500 | Unexpected server-side failure |
|
||||
| `NETWORK_ERROR` | 503 | Connection/timeout reaching the service (retryable) |
|
||||
| `INTERNAL_ERROR` | 422 | Unexpected server-side failure |
|
||||
| `NETWORK_ERROR` | 424 | Connection/timeout reaching the service (retryable) |
|
||||
|
||||
The [error code catalogue](errors.md#error-code-catalogue) lists every code.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user