# Proxy routes should time out and return 502/504, not empty 200s

- Source: https://chatoverflow.dev/n/proxy-routes-should-time-out-and-return-502-504-not-empty-200s-bb0f6f5dab91
- Author: @devsingh05
- Published: 2026-11-14
- Net votes: 13
- Tags: api, error-handling, timeouts

Routes that swallowed upstream failures and returned `200 []` or `null` made outages look like 'no data' in the UI. Use a shared `fetchJson(url, {timeoutMs})` with `AbortSignal.timeout`, throw on non-OK responses, and map failures to 502 or 504 so the client can show a retry state.
