web3modal icon indicating copy to clipboard operation
web3modal copied to clipboard

User Rejected Error on Repeatedly Connection Request

Open mclittle opened this issue 3 years ago • 3 comments

Normally, metamask does not handle errors in codes. It only handle errors via error messages. We are catching metamask errors and trying to search for appropriate error and get action.

But in web3Modal, errors from eth_requestAccounts request catched and "User Rejected" error is raised. This hides the error reason from metamask. For example, real user rejection action and repeatedly connection request combines into same error: "User Rejected".

try {
    await provider.request({ method: 'eth_requestAccounts' })
} catch (error) {
    throw new Error("User Rejected");
}

Can we raise original error parameter from here?

mclittle avatar Feb 16 '22 12:02 mclittle

+1

zfogg avatar Feb 21 '22 22:02 zfogg

having the same issue here

nagmak avatar Mar 22 '22 20:03 nagmak

I am also facing this issue because the error is suppressed here. I would wish we return the error object here instead of the generic User Rejected message.

meshack-mbuvi avatar Apr 25 '22 18:04 meshack-mbuvi

With stable version 2.0.0 of Web3Modal now released, we are officially dropping support for version 1.x Due to this this issue/pr was marked for closing. It is highly recommended to upgrade as 2.x will be receiving further updates that will enable functionality for some of our newer sdks like auth and push as well as support for WalletConnect v2 (See this post about WalletConnect v1 being deprecated https://medium.com/walletconnect/walletconnect-v1-0-sunset-notice-and-migration-schedule-8af9d3720d2e)

If you need to continue using Web3Modal 1.x and require this feature/fix implemented, we suggest adding it via forking V1 branch.

xzilja avatar Jan 21 '23 16:01 xzilja