Improve error handling for list-contributors script
This commit is contained in:
parent
359989f235
commit
6b2ac15f56
@ -21,24 +21,24 @@ module.exports = async function(callback) {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
const contributors = await kredits.Contributor.all()
|
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) {
|
} catch(e) {
|
||||||
callback(e);
|
callback(e);
|
||||||
return;
|
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())
|
console.log(table.toString())
|
||||||
|
|
||||||
callback()
|
callback()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user