feat: propagate data.cause as cause in JsonRpcError constructor#140
Merged
legobeat merged 5 commits intoMetaMask:mainfrom May 31, 2024
Merged
feat: propagate data.cause as cause in JsonRpcError constructor#140legobeat merged 5 commits intoMetaMask:mainfrom
legobeat merged 5 commits intoMetaMask:mainfrom
Conversation
88f1100 to
d4f192d
Compare
d4f192d to
e6350af
Compare
rekmarks
reviewed
May 30, 2024
74a6837 to
4b265fd
Compare
- break out util function dataHasCause with test - comment clarity - use native causes when available note: jest coverage depends on runtime
4b265fd to
09d433a
Compare
Contributor
Author
|
Validated locally that tests also pass on Node.js v14, which definitely doesn't have support for causes. We also see the expected increase in jest coverage, there. |
Contributor
Author
|
Updated with some improvements lifted over from #141 :
This branch has been published for evaluation as |
legobeat
commented
May 31, 2024
| functions: 94.44, | ||
| lines: 92.85, | ||
| statements: 92.85, | ||
| branches: 91.89, |
legobeat
added a commit
to legobeat/metamask-extension
that referenced
this pull request
May 31, 2024
published from 08108c535cf5ee25603715cbfae0cd9aa3f2dea6 MetaMask/rpc-errors#140
10 tasks
rekmarks
reviewed
May 31, 2024
Contributor
Author
|
If any reviewers are still looking at this: Pending review in #144 so follow-ups are still NBD, if you see any room for improvement. |
12 tasks
Gudahtt
pushed a commit
to MetaMask/metamask-extension
that referenced
this pull request
Oct 16, 2024
…edition) (#24496) ## **Description** - Upgrade from obsolete `eth-rpc-errors` to `@metamask/rpc-errors` - This introduce handling of error causes See [here](MetaMask/rpc-errors#140) for some context. [](https://codespaces.new/MetaMask/metamask-extension/pull/24496?quickstart=1) ## **Related issues** - #22871 #### Blocked by - [x] MetaMask/rpc-errors#158 - [x] MetaMask/rpc-errors#144 - [x] MetaMask/rpc-errors#140 #### Blocking - #22875 ## **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 completed the PR template to the best of my ability - [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. ## **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.
Gudahtt
pushed a commit
to MetaMask/metamask-extension
that referenced
this pull request
Oct 21, 2024
…edition) (#24496) - Upgrade from obsolete `eth-rpc-errors` to `@metamask/rpc-errors` - This introduce handling of error causes See [here](MetaMask/rpc-errors#140) for some context. [](https://codespaces.new/MetaMask/metamask-extension/pull/24496?quickstart=1) - #22871 - [x] MetaMask/rpc-errors#158 - [x] MetaMask/rpc-errors#144 - [x] MetaMask/rpc-errors#140 - #22875 - [x] I’ve followed [MetaMask Coding Standards](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/CODING_GUIDELINES.md). - [x] I've completed the PR template to the best of my ability - [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. - [ ] 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 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.
This maps the tc39 error
causefield onJsonRpcErrorinstances todata.cause, if it exists and is an object. No further validation is performed.This is done because adding
es2022ordomto tsconfig lib are not being considered at this point.Related
Alternative