FIXEvery API endpoint now returns structured JSON on error, never HTML 500
- Income Planner (and any other endpoint) previously showed a bare "Worker responded 500" when Polygon rate-limited. Root cause: the central dispatcher's catch block returned only
{error: msg}, so the front-end had nothing useful to display. - Central dispatcher (
worker/src/index.jslines 18-55) now classifies exceptions (polygon_rate_limit, polygon_upstream, worker_timeout, kv_binding, internal_error) and returns{error, message, hint, endpoint, asOf}so the UI can show an actionable message. - Income Planner front-end (
js/income-planner.js) now reads the response body even on non-2xx and surfaces themessageandhintfields — no more generic "Worker responded 500."
FEATPreflight Gate 16 — live endpoint health check
- New preflight gate pings 10 critical
/api/endpoints against the deployed Worker and fails the deploy if any returns HTML 500 or a malformed body. Runs on everydeploy-all.ps1post-deploy step. Skippable viaPREFLIGHT_SKIP_LIVE=1for fast local iteration. - Covers: quote, iv-rank, expected-move, skew, term-structure, gex, opportunities, plan/income (POST), ta/context, csp/leaderboard.