Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error is not returned in promise upon cancelling transaction in desk and mobile. #492

Open
IDontLikeOpen opened this issue Jan 18, 2024 · 0 comments

Comments

@IDontLikeOpen
Copy link

When users submits transaction - we get a result and it is returned in then, but when transaction is rejected catch is not triggered, even though we get the error in the console.

image

The line mentioned in the error is this, but it is hard to figure out why it work the way it does.

image

I am using "web3": "^4.2.2"

const transferData = {
    method: 'transfer',
    types: ['address', 'uint256'],
    inputs: [
      '0x090.....',
      {
        type: 'BigNumber',
        hex: '0x0f4240',
      },
    ],
    names: ['_recipient', '_value'],
  }

 const transferMethod = () =>
        contract.methods.transfer(toAddress, `${amountToPay}`);

transferMethod()
      .send({
        from: senderAddress,
        gasPrice,
        data,
      })
      .then((result) => result)
      .catch((errorString) => errorString);

Pancake.swap handles it somehow, so there must be a way. Thanks for your tme!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants
@IDontLikeOpen and others