From 6c8491e67b1353ff51f5b88a1276881e1f6710e4 Mon Sep 17 00:00:00 2001 From: Sebastian Kippe Date: Thu, 13 Jun 2019 17:38:34 +0200 Subject: [PATCH] Handle errors in seed funding --- scripts/seeds.js | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/scripts/seeds.js b/scripts/seeds.js index 7115ae2..027e3dd 100644 --- a/scripts/seeds.js +++ b/scripts/seeds.js @@ -17,13 +17,15 @@ module.exports = async function(callback) { let fundingAmount = 2; each(seeds.funds, (address, next) => { console.log(`funding ${address} with 2 ETH`); - web3.eth.sendTransaction({ - to: address, - value: web3.toWei(fundingAmount), - from: web3.eth.accounts[0] - }, - (result) => { next(); } - ) + try { + web3.eth.sendTransaction({ + to: address, + value: web3.toWei(fundingAmount), + from: web3.eth.accounts[0] + }, result => next()) + } catch(e) { + console.log('FAILED:', e); + } }); each(seeds.contractCalls, (call, next) => {