Print the platform's refusal rather than the JSON it arrived in #17
No reviewers
Labels
No labels
⏳in-progress
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
Grey.ooo/someones.computer_agent!17
Loading…
Reference in a new issue
No description provided.
Delete branch "feature/surface-platform-refusals"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
A bundle upload that fails has been reporting the raw response body next to the
status line:
That was tolerable while every failure was a malformed manifest or a bad token.
The platform now refuses a deploy for want of credit, in prose it expects a
human to act on — the balance and where to top it up — and pasting the JSON
around that sentence buries the one part that matters.
The decoding already existed for the
/cliroutes. Extracted fromdo()intoapiErrorFrom()and reused, soUploadBundlereturns an*APIErrorlikeeverything else: the message reads as written, and a caller can still branch on
the status.
Verification
go build ./...,go vet ./...,gofmt,go test ./...— all clean, plus anew
TestUploadBundleSurfacesThePlatformsRefusalcovering the 402 path.Exercised against a live control plane running the server half
(Grey.ooo/Someones.Computer#310): the output above is the real binary against a
zeroed balance, and the same deploy went through once the balance was restored.
Depends on
Nothing — the server sends
{"error": …}on every route this touches already.The 402 it was written for arrives with Grey.ooo/Someones.Computer#310.