I am doing error handling in an app using polkadotJSAPI 7.13.1
There are two ways to fetch info if an extrinsic succeeds or fails, the first one is via dispatchError
in signAndSend
like so
transferExtrinsic.signAndSend(account_from, { signer: injector.signer }, ({ status, events, dispatchError }) => {
The second is described in docs
Both generally work for most extrinsics, but not for
transferExtrinsic = api.tx.balances.transfer(account_to, (amount));,
for example when trying to send more tokens than exists in a wallet. Both approaches give either DispatchError = undefined or doesn't find an event with extrinsicfailed. PolkadotJS web interface catches the error correctly. How do I check if any extrinsic succeeds or errors out, including balances.transfer extrinsic?