How to handle provider errors? (especially network errors) #3604
Unanswered
nacknime-official
asked this question in
Q&A
Replies: 1 comment 1 reply
-
Have you tried getBlock(1).catch(e=> console.log(e)) ? |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
v5.7.2
I expect that any error on "provider.getBlock(1)" will be caught, but seems Ethers don't propagate "non-ethers" errors such as networks errors and the app is just crashing.
Output:
I don't understand how to handle errors with Ethers and how to built a fault-tolerant app on top of it.
Beta Was this translation helpful? Give feedback.
All reactions