Conversation
🦋 Changeset detectedLatest commit: 6e141bf The changes in this PR will be included in the next version bump. This PR includes changesets to release 24 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
10 Skipped Deployments
|
Contributor
There was a problem hiding this comment.
Pull Request Overview
Updates the error handling in SwapController to show "Insufficient liquidity" when there's insufficient liquidity instead of the misleading "Insufficient balance" error message.
- Added
handleSwapErrorutility function to parse API error responses and identify insufficient liquidity errors - Updated SwapController to use the new error handling function when quote fetching fails
- Added comprehensive test coverage for the new error handling logic
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| packages/controllers/src/utils/SwapApiUtil.ts | Adds new handleSwapError function to parse API errors and detect insufficient liquidity |
| packages/controllers/src/controllers/SwapController.ts | Updates error handling in swapTokens to use new error parsing utility |
| packages/controllers/tests/utils/SwapApiUtil.test.ts | Adds test coverage for the new handleSwapError function |
| .changeset/little-grapes-arrive.md | Documents the change in the changeset |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
tomiir
reviewed
Sep 11, 2025
Contributor
Coverage Report
File Coverage
|
||||||||||||||||||||||||||||||||||||||||||||
0xmkh
reviewed
Sep 11, 2025
tomiir
approved these changes
Sep 12, 2025
0xmkh
approved these changes
Sep 12, 2025
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Description
On SwapController, we are fetching quotes but when there is insufficient liquidity, we are showing insufficient balance error instead, which is misleading
Type of change
Associated Issues
For Linear issues: Closes APKT-xxx
For GH issues: closes #...
Showcase (Optional)
If there is a UI change include the screenshots with before and after state.
If new feature is being introduced, include the link to demo recording.
Checklist