fix: log only a msg in case of insufficient funds
This commit is contained in:
parent
ff474ee507
commit
f740942f42
1 changed files with 7 additions and 2 deletions
|
|
@ -10,7 +10,7 @@ const ticker = require('../lib/ticker')
|
||||||
|
|
||||||
const [toAddress, cryptoValue, cryptoCode] = process.argv.slice(2)
|
const [toAddress, cryptoValue, cryptoCode] = process.argv.slice(2)
|
||||||
|
|
||||||
function computeCrypto (cryptoCode, value) {
|
function computeCrypto(cryptoCode, value) {
|
||||||
try {
|
try {
|
||||||
const cryptoRec = coinUtils.getCryptoCurrency(cryptoCode)
|
const cryptoRec = coinUtils.getCryptoCurrency(cryptoCode)
|
||||||
const unitScale = cryptoRec.unitScale
|
const unitScale = cryptoRec.unitScale
|
||||||
|
|
@ -80,7 +80,12 @@ settingsLoader.loadLatest()
|
||||||
console.log('Success.')
|
console.log('Success.')
|
||||||
process.exit(0)
|
process.exit(0)
|
||||||
})
|
})
|
||||||
.catch(console.log)
|
.catch(e => {
|
||||||
|
if (e.name === 'InsufficientFundsError')
|
||||||
|
console.log(e.message)
|
||||||
|
else
|
||||||
|
console.log(e)
|
||||||
|
})
|
||||||
})
|
})
|
||||||
.catch(console.log)
|
.catch(console.log)
|
||||||
})
|
})
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue