Handle errors in contributor list script #109
@ -15,12 +15,16 @@ module.exports = async function(callback) {
|
|||||||
|
|
||||||
console.log(`Using Contributor at: ${kredits.Contributor.contract.address}`);
|
console.log(`Using Contributor at: ${kredits.Contributor.contract.address}`);
|
||||||
|
|
||||||
|
|
||||||
const table = new Table({
|
const table = new Table({
|
||||||
head: ['ID', 'Account', 'Name', 'Core?', 'Balance', 'IPFS']
|
head: ['ID', 'Account', 'Name', 'Core?', 'Balance', 'IPFS']
|
||||||
})
|
})
|
||||||
|
|
||||||
let contributors = await kredits.Contributor.all()
|
try {
|
||||||
|
const contributors = await kredits.Contributor.all()
|
||||||
|
} catch(e) {
|
||||||
|
callback(e);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
contributors.forEach((c) => {
|
contributors.forEach((c) => {
|
||||||
table.push([
|
table.push([
|
||||||
@ -32,7 +36,9 @@ module.exports = async function(callback) {
|
|||||||
c.ipfsHash
|
c.ipfsHash
|
||||||
])
|
])
|
||||||
})
|
})
|
||||||
|
|
||||||
console.log(table.toString())
|
console.log(table.toString())
|
||||||
|
|
||||||
callback()
|
callback()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user