From 0fed4586bfd33ef5d04fa992f84aed2ff87be575 Mon Sep 17 00:00:00 2001 From: Richard Moore Date: Mon, 1 Jul 2019 01:26:41 -0400 Subject: [PATCH] Better error on transaction rejection. --- script.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/script.js b/script.js index 6a2b881..61b1d3c 100644 --- a/script.js +++ b/script.js @@ -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;