From f740942f42d867e83324d6ad4f113c0e27ecd763 Mon Sep 17 00:00:00 2001 From: Nikola Ubavic <53820106+ubavic@users.noreply.github.com> Date: Wed, 27 Oct 2021 18:38:33 +0200 Subject: [PATCH] fix: log only a msg in case of insufficient funds --- bin/lamassu-send-coins | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/bin/lamassu-send-coins b/bin/lamassu-send-coins index c47af7ff..ab755898 100755 --- a/bin/lamassu-send-coins +++ b/bin/lamassu-send-coins @@ -10,7 +10,7 @@ const ticker = require('../lib/ticker') const [toAddress, cryptoValue, cryptoCode] = process.argv.slice(2) -function computeCrypto (cryptoCode, value) { +function computeCrypto(cryptoCode, value) { try { const cryptoRec = coinUtils.getCryptoCurrency(cryptoCode) const unitScale = cryptoRec.unitScale @@ -80,7 +80,12 @@ settingsLoader.loadLatest() console.log('Success.') process.exit(0) }) - .catch(console.log) + .catch(e => { + if (e.name === 'InsufficientFundsError') + console.log(e.message) + else + console.log(e) + }) }) .catch(console.log) })