From 6b2ac15f561a0f4bcc5ec88a3457558161c6dd3b Mon Sep 17 00:00:00 2001 From: Sebastian Kippe Date: Wed, 24 Apr 2019 13:46:27 +0100 Subject: [PATCH] Improve error handling for list-contributors script --- scripts/list-contributors.js | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/scripts/list-contributors.js b/scripts/list-contributors.js index 235fffb..88cc126 100644 --- a/scripts/list-contributors.js +++ b/scripts/list-contributors.js @@ -21,24 +21,24 @@ module.exports = async function(callback) { try { const contributors = await kredits.Contributor.all() + + contributors.forEach((c) => { + table.push([ + c.id.toString(), + c.account, + `${c.name}`, + c.isCore, + ethers.utils.formatEther(c.balance), + c.totalKreditsEarned.toString(), + c.contributionsCount.toString(), + c.ipfsHash + ]) + }) } catch(e) { callback(e); return; } - contributors.forEach((c) => { - table.push([ - c.id.toString(), - c.account, - `${c.name}`, - c.isCore, - ethers.utils.formatEther(c.balance), - c.totalKreditsEarned.toString(), - c.contributionsCount.toString(), - c.ipfsHash - ]) - }) - console.log(table.toString()) callback()