zoo api discards the server error body and duplicates the reason phrase (e.g. "404 Not Found Not Found")
Context: API Makeathon participant. Found while reviewing the raw api command's error path.
On a non-success status, zoo api returns without reading the response body, and formats both status and status.canonical_reason(), although the status display already includes the reason phrase (src/cmd_api.rs:172-193). The actionable JSON or text error the server sent is lost, and the generic status text is repeated. A checked-in test codifies the 404 Not Found Not Found output (src/tests.rs:587-594).
Concrete failure
A validation or authorization failure appears as 404 Not Found Not Found (or similar) with no server explanation. The user loses the request id, the error code, and the human-readable message that would tell them what went wrong.
Verify
Return a non-success response containing a distinctive JSON sentinel in the body. Current stderr omits the sentinel and repeats the reason phrase.
Suggested fix
Read and surface the response body on error, and format the status once (drop the redundant canonical_reason()).
Environment
Zoo CLI v0.2.184 (33534cd). Reviewed against the current main of KittyCAD/cli.
zoo apidiscards the server error body and duplicates the reason phrase (e.g. "404 Not Found Not Found")Context: API Makeathon participant. Found while reviewing the raw
apicommand's error path.On a non-success status,
zoo apireturns without reading the response body, and formats bothstatusandstatus.canonical_reason(), although thestatusdisplay already includes the reason phrase (src/cmd_api.rs:172-193). The actionable JSON or text error the server sent is lost, and the generic status text is repeated. A checked-in test codifies the404 Not Found Not Foundoutput (src/tests.rs:587-594).Concrete failure
A validation or authorization failure appears as
404 Not Found Not Found(or similar) with no server explanation. The user loses the request id, the error code, and the human-readable message that would tell them what went wrong.Verify
Return a non-success response containing a distinctive JSON sentinel in the body. Current stderr omits the sentinel and repeats the reason phrase.
Suggested fix
Read and surface the response body on error, and format the status once (drop the redundant
canonical_reason()).Environment
Zoo CLI v0.2.184 (33534cd). Reviewed against the current
mainof KittyCAD/cli.