Skip to content

Commit

Permalink
Better error on transaction rejection.
Browse files Browse the repository at this point in the history
  • Loading branch information
ricmoo committed Jul 1, 2019
1 parent 1dd0249 commit 0fed458
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion script.js
Expand Up @@ -321,7 +321,13 @@
let txs = await takoyaki.getTransactions(label, owner, salt, dustWallet.address);
console.log(txs);

let tx = await signer.sendTransaction(txs.commit);
let tx = null;
try {
tx = await signer.sendTransaction(txs.commit);
} catch (error) {
console.log(error);
throw new Error("Cancelled Transaction.");
}

let receipt = await tx.wait();
hints.commitBlock = receipt.blockNumber;
Expand Down

0 comments on commit 0fed458

Please sign in to comment.