Repository navigation
fix(routes): show API error details in Try a route - #1213
Merged
Merged
Conversation
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.
What
When a Routes API error carries
details, Try a route now shows the API's message and details in place of the two guides that only say to retry (quote_not_available,deposit_address_not_available). Every other guide, and every request made with the docs demo key, keeps its guide.Why
Before, a
quote_not_availableerror always showed "No quote is available for this route right now. Try another amount, or try again later." That was true even when the API said exactly what was wrong, such as "The sender is not authorized for this route." When a transfer is refused because the wallet isn't approved for a pair, the reader now sees that reason on the step that failed.Guides with a next step (such as "Do not send again") and docs-key and subsidy guides are unchanged. The demo key's refusals aren't the reader's own, so keyless requests keep the generic guide.
Checks
vitest run src/lib/routes-execution.test.ts(17 passed, with cases for details replacing a retry guide, a next-step guide kept, and the demo key kept)biome checkon the changed files