You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[P2][errors] error.code is set to the whole human message for {status:"fail", data:{error:"<sentence>"}} responses #145
Confirmed live on 2026-09-13 against production, with origin/main4bd2900 code plus the #101 branch. The defect is in error_from_response, which is unchanged on main.
When the API answers with the render_fail envelope, data.error is a human sentence, not a machine code. The SDK copies that sentence into error.code and error.machine_code. Anything that branches or aggregates on error.code sees a unique free-text string per request, for example one that embeds the requested slug.
Every V1::FuelSurchargeController 400/404 uses this shape, and so do other render_fail callers in the API.
Expected
When data.error is a sentence rather than a code-shaped token, leave error.code as None (or derive a stable code from the status). Keep the sentence in message. A narrow fix: only fall back to data.error when it matches something like ^[A-Z][A-Z0-9_]*$.
Before changing this, check tests/unit/test_error_contract.py for any pinned legacy fixture that relies on the fallback.
Activity
chore(release): 1.16.0 (#152)