mirror of
https://github.com/mikecarper/MeshCore.git
synced 2026-09-15 22:15:35 +00:00
A bare 404 carries no body, so r.json() rejected and the parse failure escaped with no HTTP status attached. Every caller then had to treat "this route does not exist" as an ambiguous network failure — for the CLI that meant ~14 seconds of polling before reporting a lost connection, which is the wrong diagnosis and the wrong wait. api() now substitutes an empty object when an *error* response has no readable JSON, so the status survives onto the error. Successful responses must still parse, or a captive portal's HTML would sail through as valid config. The CLI names the case outright: firmware without /api/cli says so in 100ms instead of retrying a route that will never exist.