In javascript I run contract's method
contract[methodName](...params, { from: myAccount }, (err, response) => {
console.log('get transaction', methodName, err, response);
if (err) return reject(err);
resolve(response);
});
and then reject transaction through MetaMask. In console get an error
MetaMask - RPC Error: Error: MetaMask Tx Signature: User denied transaction signature.
But I can't catch this error in my code. Callback not working.
How can i catch this error in JS?