Skip to content
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

Make provider errors more useful #3487

Closed
danfinlay opened this issue Mar 9, 2018 · 1 comment
Closed

Make provider errors more useful #3487

danfinlay opened this issue Mar 9, 2018 · 1 comment

Comments

@danfinlay
Copy link
Contributor

danfinlay commented Mar 9, 2018

Related to #3140

When we switched to the new infura provider, we seem to have regressed in error comprehensibility. We are throwing generic -32603 for a ton of cases.

Here's one simple web3 call that throws this error:

web3.currentProvider.sendAsync({ method: 'debug_traceTransaction', params: ['0x33ab8f2c2f73aaef9e0d1b620d8aeabd37dd8f975bb3743d11278ec13214ba38'], from: web3.eth.accounts[0] }, console.log)

The response doesn't give us much to go on:

error: code: -32603
id: undefined
jsonrpc: undefined

I'll lay that out as our first test-case. We should return at least a "method not found" error when a non existent method is thrown. Hopefully while that error message is added, we can pass some more meaningful data back in general, too.

@danfinlay
Copy link
Contributor Author

Related to #3622

@bitpshr bitpshr self-assigned this May 2, 2018
@bitpshr bitpshr modified the milestones: Sprint 04, Sprint 05 May 6, 2018
@ghost ghost added the in progress label May 6, 2018
@ghost ghost removed the in progress label May 18, 2018
github-merge-queue bot pushed a commit that referenced this issue Nov 8, 2024
…28236)

## **Description**

Remove usages of global network selectors from transaction confirmation
React components and hooks.

Specifically:

- Remove usages of the following selectors:
  - `getConversionRate`
  - `getCurrentChainId`
  - `getNativeCurrency`
  - `getNetworkIdentifier`
  - `getNftContracts`
  - `getNfts`
  - `getProviderConfig`
  - `getRpcPrefsForCurrentProvider`
- Add new selectors:
  - `selectConversionRateByChainId`
  - `selectNftsByChainId`
  - `selectNftContractsByChainId`
  - `selectNetworkIdentifierByChainId`
- Add ESLint rule to prevent further usage of global network selectors
in confirmations directory.

[![Open in GitHub
Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/28236?quickstart=1)

## **Related issues**

Fixes:
[#3469](MetaMask/MetaMask-planning#3469)
[#3373](MetaMask/MetaMask-planning#3373)
[#3486](MetaMask/MetaMask-planning#3486)
[#3487](MetaMask/MetaMask-planning#3487)

## **Manual testing steps**

Full regression of all transaction confirmations and related
functionality.

## **Screenshots/Recordings**

### **Before**

### **After**

## **Pre-merge author checklist**

- [x] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask
Extension 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.

---------

Co-authored-by: Jyoti Puri <jyotipuri@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants