Web3Provider Error not parsed correctly
See original GitHub issueWhen 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.

Issue Analytics
- State:
- Created 3 years ago
- Comments:16 (7 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

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_anddebug_APIs available that can recover what went wrong.But a tracing node is substantially more expensive to run.
Are you using MetaMask? That result seems very bizarre, since it includes a
statusbut theblockNumberandblockHashare 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… 😒