I have an async function web3.eth.net.isListening()
that causes the following statement to be stuck forever if there is an error:
await web3.eth.net.isListening()
How can we let the above await
statement timeout after 10 seconds, and do a console.log
to show that an error has occurred?