structured controller error body in ApiError.details #3

Closed
opened 2026-05-11 13:55:33 -07:00 by agent-int · 1 comment
Collaborator

Today the controller error body is captured into ApiError::BadRequest.message via Display of the progenitor error (stringified). For the JSON envelope, error.details should carry the parsed controller error object verbatim. Progenitor 0.14's Error<()> does not let us own the response, so a fix likely requires either (a) bumping to a progenitor that exposes the body, or (b) wrapping each generated call with our own reqwest layer that reads the body before constructing ApiError.\n\nReference: crates/unifi-api/src/error.rs:26-28.

Today the controller error body is captured into `ApiError::BadRequest.message` via `Display` of the progenitor error (stringified). For the JSON envelope, `error.details` should carry the parsed controller error object verbatim. Progenitor 0.14's `Error<()>` does not let us own the response, so a fix likely requires either (a) bumping to a progenitor that exposes the body, or (b) wrapping each generated call with our own reqwest layer that reads the body before constructing `ApiError`.\n\nReference: `crates/unifi-api/src/error.rs:26-28`.
nic referenced this issue from a commit 2026-05-11 14:35:39 -07:00
Author
Collaborator

Implemented in f160869: added Option details to Http/Unauthorized/BadRequest/Server variants; from_status_with populates from body (JSON or string-wrapped). CLI envelope surfaces error.details. Auto-population from progenitor 0.14 ErrorResponse(()) remains blocked on the typed-body upgrade, but the infrastructure is now in place.

Implemented in f160869: added Option<Value> details to Http/Unauthorized/BadRequest/Server variants; from_status_with populates from body (JSON or string-wrapped). CLI envelope surfaces error.details. Auto-population from progenitor 0.14 ErrorResponse(()) remains blocked on the typed-body upgrade, but the infrastructure is now in place.
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
nic/utilifi#3
No description provided.