question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Web3Provider Error not parsed correctly

See original GitHub issue

When a transaction submitted through the Web3Provider reverts, ethers will sometimes parse it as a “gas too low” error even though there is another cause.

See the screenshot attached. The top error (which I’m not able to catch) clearly shows the message is “commitment too new”, while ethers thinks it’s something else.

It would be good to also be able to access the original error object. At the moment it looks like I can only access the string, which I log below the original message.

image

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:16 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
ricmoocommented, Mar 2, 2021

Oh! One more thought. This is prolly a lot more work, and may require paid tiers to INFURA and Alchemy (or running your own Geth with tracing enabled), but if a transaction fails, there are trace_ and debug_ APIs available that can recover what went wrong.

But a tracing node is substantially more expensive to run.

1reaction
ricmoocommented, Mar 2, 2021

Are you using MetaMask? That result seems very bizarre, since it includes a status but the blockNumber and blockHash are null.

It’s only able to display the succinct message if the backend sends it in a machine readable format. But that is only possible in a call, the Ethereum JSON-RPC gobbles it up in its return value.

We are having a couple meetings per month though to get the JSON-RPC API cleaned up a bit though. This sort of thing is exactly what we’ve spent the last few months discussing. 😃

But it likely won’t be resolved any time soon… 😒

Read more comments on GitHub >

github_iconTop Results From Across the Web

Working with Web3Modal - provider.on('network ... - GitHub
What's weird though, is my `chainChanged' event is called just fine. Code Snippet. const provider = await web3Modal.connect(); const ...
Read more >
web3js - Detect if web3 provider has successfully connected
If there is no node running at localhost, I see an error in browser console: Error: Invalid JSON RPC response: "".
Read more >
web Initialization is not working correctly? - Stack Overflow
I am very new to ethereum stuff. I have built a contract and have deployed to rinkby test network. To get the Web...
Read more >
Error - Can't resolve '@walletconnect/web3-provider'
When walletconnect is installed I can't deploy code successfully to cloud. So I removed walletconnect and deployed successfully.
Read more >
Documentation - Ethers.js
A Web3Provider wraps a standard Web3 provider, which is // what MetaMask ... In JavaScript, memory may not be securely allocated, or more...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found