mirror of
https://github.com/fabro-sh/fabro.git
synced 2026-08-28 05:27:41 +00:00
`map_api_error_structured` had no arm for progenitor's
`InvalidResponsePayload`, so it fell through to the `other` branch and was
rendered by progenitor's own Display:
Error::InvalidResponsePayload(b, e) => write!(f, "Invalid Response Payload ({:?}): {}", b, e)
That `{:?}` dumps the entire body. Running a 0.254 CLI against a 0.333
server turned `fabro inspect` into 30KB of escaped JSON with no statement
of the cause, and `fabro events` did the same. `fabro version` and
`fabro doctor` both report the mismatch correctly; the commands that
actually fail did not.
Give the variant its own arm. The message now leads with the schema
mismatch, names the CLI version, and points at `fabro version` to compare
with the server followed by `fabro upgrade`. It mentions `--prerelease`
because the plain upgrade path only considers stable releases, so a server
on a nightly leaves the CLI reporting it is already current. The body is
kept as a 200-character preview, enough to recognize the payload without
scrolling the remediation away.
`classify_api_error` delegates to `map_api_error_structured`, so it picks
this up too.
Verified with cargo check, cargo test (9 passed, including the 7 that
already existed), and cargo clippy --all-targets -- -D warnings, all on
stable 1.98.0 in Docker. The pinned nightly-2026-04-14 fmt and clippy runs
that CI uses have not been run.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HMb7GgUkEkk8CWc6MPpy2w
|
||
|---|---|---|
| .. | ||
| apps | ||
| components | ||
| foundation | ||
| packages/fabro-api-client | ||