refactor: update error boundary to handle wk error messages properly#4966
Merged
enesozturk merged 4 commits intomainfrom Sep 7, 2025
Merged
Conversation
🦋 Changeset detectedLatest commit: 89e4fde 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
This PR refactors the error boundary to better handle WalletKit error messages by extracting the message property from error objects before falling back to JSON stringification.
- Updates error handling logic to prioritize
error.messageover JSON stringification - Adds a changeset documenting the improvement to error message display in toasts
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| packages/controllers/src/utils/withErrorBoundary.ts | Modified error handler to extract message property from error objects |
| .changeset/ready-ducks-send.md | Added changeset documenting the error handling improvement |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Contributor
Coverage Report
File Coverage
|
||||||||||||||||||||||||||||||||||||||
0xmkh
approved these changes
Sep 5, 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 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.
Description
When any error thrown on WalletKit, AppKit handle those with
withErrorBoundaryand stringifying objects. But the WK errors already returned as object and includesmessageproperty which will be enough for us to show proper messages.In this PR it updates the error boundary to look for the error.message first use it if exist.
Type of change
Associated Issues
For Linear issues: Closes APKT-3595
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