How to catch ETIMEDOUT error #4066
Unanswered
moneyDev1111
asked this question in
Q&A
Replies: 1 comment 11 replies
-
If you are not able to catch the error and the script terminates, I think it's unhandled promise rejection inside ethers.js which might be a bug in ethers.js. To confirm, can you add this code snippet: process.on('unhandledRejection', error => {
console.log('unhandledRejection', error);
}); Expected behaviour after adding this snippet is your script should not stop and the ETIMEDOUT error should keep logging in the console. |
Beta Was this translation helpful? Give feedback.
11 replies
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.
-
Hi, I use ethers 6.3.0, and a script that makes a lot of things and should work for days if not months.. and so it works and all errors are succesfully catched but this one
Error: connect ETIMEDOUT 104.18.35.56:443 at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1494:16) { errno: -4039, code: 'ETIMEDOUT', syscall: 'connect', address: '104.18.35.56', port: 443 }
and it stops the script... I wonder why and how should I catch it.. it's seems logically to happen inside of Provider? well ok, still it should be catched? all of the logics is inside the try catch block in my code and any error despite this one doesn't cause the script to stop...
It's like the error is thrown from somewhere outside of the main func which is weird.... Could someone explain how to catch this error? Thank you
Beta Was this translation helpful? Give feedback.
All reactions