Replace raw HTTP error leakage with user-friendly messages#68
Merged
George-iam merged 2 commits intomainfrom Mar 24, 2026
Merged
Replace raw HTTP error leakage with user-friendly messages#68George-iam merged 2 commits intomainfrom
George-iam merged 2 commits intomainfrom
Conversation
- Replace 8 sites that exposed raw HTTP response bodies to users with httpErrorMessage() which translates status codes to actionable messages (401→"Run axme login", 403→"Permission denied", 429→quota details, etc.) - Fix printResult to show user-friendly errors instead of dumping raw JSON in non-JSON mode for error responses (status >= 400) - Clarify --bearer-token help text as alias for --actor-token All tests pass.
Detail field in error responses can be either a string or an array of validation error objects. Parse both formats to extract user-friendly message instead of showing "Request failed (422)." with no context. Before: "Request failed (422)." After: "Request failed (422): Input should be a valid UUID, ..."
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
"personal context returned 401: {\"error\":{...}}") withhttpErrorMessage()which provides actionable messagesprintResultto show user-friendly errors instead of dumping raw JSON body for error responses in non-JSON mode--bearer-tokenhelp text as alias for--actor-tokenSites fixed
newStatusCmd(gateway health)personalContextFromServer(whoami/context)personalWorkspaceSelectionAPIError(workspace selection)enterpriseMembersAPIError(member operations)serviceAccountsAPIError(service account operations)listAccountSessions(session list)revokeAccountSessionByID(session revoke)logoutAll(logout-all)Test plan
go build ./...compilesgo test ./...passes