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.

Error thrown from EtherscanProvider.call via FallbackProvider not catchable

See original GitHub issue

When the FallbackProvider.call invokes EtherscanProvider.call, the error thrown (https://github.com/ethers-io/ethers.js/blob/master/providers/etherscan-provider.js#L209) isn’t catchable because the setTimeout has the error thrown on a different async stack: https://github.com/ethers-io/ethers.js/blob/master/providers/fallback-provider.js#L103.

If EtherscanProvider.call instead returns Promise.reject(...), it works as expected.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:11 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
ricmoocommented, Mar 17, 2020

This has been published to 4.0.46. Try it out and let me know if you have any problems. 😃

1reaction
ricmoocommented, Mar 13, 2020

Yeah, exactly what I was trying… It has to fail in a weird way and not on the first run (otherwise it fails in that async loop). It’s ok, I just hacked in some things directly to force it to fail. 😃

The fixes are in, but I’m looking through for other low-hanging fruit, since it takes about an hour for the tests to run and do all the admin tasks to cut a release. I’ll update this ticket when it is published to npm.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Providers — ethers.js 4.0.0 documentation
A Provider abstracts a connection to the Ethereum blockchain, for issuing queries and sending signed state changing transactions. The EtherscanProvider and ...
Read more >
Logging - Ethers.js
Create a new logger which will include version in all errors thrown. ... This may occur when calling a method on a sub-class...
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