fix: error response body - #20
Merged
EvilFreelancer merged 1 commit intoAug 21, 2026
Merged
Conversation
EvilFreelancer
approved these changes
Aug 21, 2026
Owner
|
Hi @itsyoboieltr! Thanks for your PR, it was merged and released as v0.1.19 |
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.
Problem
When a request fails, the CLI only printed axios's default message:
That's not enough to act on. In practice, the useful part of an HTTP error is almost always in the response body, like validation errors (
field email must be unique), auth errors (token expired), server errors with tracebacks, etc. Without it, you're left guessing what the server objected to.This matters most for agent-driven usage: an agent that hits a 400/422/500 needs the body to diagnose and self-correct (fix the payload, retry with a different value, stop). Today it gets a status code and nothing else, so it can't debug the failure at all, it can only retry blindly or give up.
Change
In
runApiCommand, catch request errors and, when the error carries a response body, append it (pretty-printed) to the error message:instanceof AxiosError, only real axios errors are affected, everything else is rethrown unchanged.