alchemyplatform/alchemy-web3

Unable to catch error when using alchemy web3. Works for regular web3

elie222 opened this issue · 3 comments

We fetch auctions but the smart contract throws an error when the auction doesn't exist.
We don't mind about that and just want to skip the error.

This line works for web3 but shows an Unhandled Promise error when using this library:

return await salesInstance.methods.getAuction(id).call().catch(err => null)

I have to remember to always check issues on Github before I pull my hair out. 💡

Same issue, just switched to regular web3 and it resolved it.

In my case it's with contract.methods.METHOD.call()

brg8 commented

Hi @elie222 and @Alasano . So sorry for not seeing this for three weeks! Could you post a more complete reproduction for me? I am unable to reproduce the error on my end.

You can try upgrading to 1.1.3 as that has the latest web3 dependencies.

brg8 commented

Closing for now, feel free to submit new reports and I will re-open to investigate. Thanks!