-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added MIP for fix error handling in API Responses #36
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good and straightforward in general. Though I think it would be good to get more examples in here
Co-authored-by: jiexi <[email protected]>
Would also be good to add some timeline guidance for when we might be rolling this out |
@adonesky1 not sure what we should put for the timeline. any ideas? |
6 months after MIP finalized? We should also mention that we will provide several example wrapped stringified errors and what they will look like after the changes. |
6 months seems like a lot to me... Maybe 3 months after finalized? Maybe we should check with @Gudahtt about how long we've waited in the past? We should probably have some protocol going forward. |
Issue https://github.com/MetaMask/metamask-extension/issues/19697, https://github.com/MetaMask/metamask-extension/issues/15250 and https://github.com/MetaMask/metamask-extension/pull/15205#issuecomment-1199953855 highlighted difficulties faced by developers due to the API's error handling mechanism, where some errors are wrapped and stringified. This change proposes to break some existing error cases to facilitate clearer understanding and quicker resolution of issues. | ||
|
||
#### Specification | ||
- **Current Behaviour:** Errors returned by the API are wrapped and stringified, leading to terribly formatted error messages in some cases. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, I had always thought of this as a bug, rather than a part of how the API works. But it's a fair point that we would expect dapps to expect these responses.
Do we know if we return these mangled stringified errors for all errors? Or just certain classes of them? I thought we returned proper Ethereum JSON-RPC errors at least some of the time.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would be good to drill in on what specific methods/scenarios we see these poorly formatted errors.
Co-authored-by: Alex Donesky <[email protected]>
Co-authored-by: Vandan <[email protected]>
Co-authored-by: Vandan <[email protected]>
The Journey through Error Wrapping in MetaMaskBackground The Issue Reference to the old transaction controller can be found here, and the new transaction controller utilizing Discovery and Resolution Further investigation revealed that Challenges and Insights Lessons Learned
Moving Forward |
#22875) ## **Description** ## **Related issues** - #27784 - MetaMask/eth-json-rpc-middleware#335 - #27917 - #18510 - #15250 - MetaMask/metamask-improvement-proposals#36 ### Blocked by - [x] #24496 ### Follow-up to - #24496 ## **Manual testing steps** ## **Screenshots/Recordings** ### **Before** ### **After** ## **Pre-merge author checklist** - [x] I’ve followed [MetaMask Coding Standards](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/CODING_GUIDELINES.md). - [x] I've clearly explained what problem this PR is solving and how it is solved. - [x] I've linked related issues - [x] I've included manual testing steps - [x] I've included screenshots/recordings if applicable - [x] I’ve included tests if applicable - [x] I’ve documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [x] I’ve applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. - [x] I’ve properly set the pull request status: - [x] In case it's not yet "ready for review", I've set it to "draft". - [x] In case it's "ready for review", I've changed it from "draft" to "non-draft". ## **Pre-merge reviewer checklist** - [ ] I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed). - [ ] I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots.
#22875) ## **Description** ## **Related issues** - #27784 - MetaMask/eth-json-rpc-middleware#335 - #27917 - #18510 - #15250 - MetaMask/metamask-improvement-proposals#36 ### Blocked by - [x] #24496 ### Follow-up to - #24496 ## **Manual testing steps** ## **Screenshots/Recordings** ### **Before** ### **After** ## **Pre-merge author checklist** - [x] I’ve followed [MetaMask Coding Standards](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/CODING_GUIDELINES.md). - [x] I've clearly explained what problem this PR is solving and how it is solved. - [x] I've linked related issues - [x] I've included manual testing steps - [x] I've included screenshots/recordings if applicable - [x] I’ve included tests if applicable - [x] I’ve documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [x] I’ve applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. - [x] I’ve properly set the pull request status: - [x] In case it's not yet "ready for review", I've set it to "draft". - [x] In case it's "ready for review", I've changed it from "draft" to "non-draft". ## **Pre-merge reviewer checklist** - [ ] I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed). - [ ] I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots.
#22875) - #27784 - MetaMask/eth-json-rpc-middleware#335 - #27917 - #18510 - #15250 - MetaMask/metamask-improvement-proposals#36 - [x] #24496 - #24496 - [x] I’ve followed [MetaMask Coding Standards](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/CODING_GUIDELINES.md). - [x] I've clearly explained what problem this PR is solving and how it is solved. - [x] I've linked related issues - [x] I've included manual testing steps - [x] I've included screenshots/recordings if applicable - [x] I’ve included tests if applicable - [x] I’ve documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [x] I’ve applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. - [x] I’ve properly set the pull request status: - [x] In case it's not yet "ready for review", I've set it to "draft". - [x] In case it's "ready for review", I've changed it from "draft" to "non-draft". - [ ] I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed). - [ ] I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots.
This proposal aims to refine MetaMask's API error handling by eliminating the practice of stringifying or wrapping errors. The current method obscures underlying issues, complicating debugging and resolution for developers.