handle cash-in errors
This commit is contained in:
parent
48dd23c11d
commit
86adfd0a63
7 changed files with 40 additions and 24 deletions
|
|
@ -1,6 +1,8 @@
|
|||
const BitGo = require('bitgo')
|
||||
const BN = require('../../../bn')
|
||||
|
||||
const E = require('../../../error')
|
||||
|
||||
const pjson = require('../../../../package.json')
|
||||
const userAgent = 'Lamassu-Server/' + pjson.version
|
||||
|
||||
|
|
@ -38,9 +40,7 @@ function sendCoins (account, address, cryptoAtoms, cryptoCode) {
|
|||
return result.hash
|
||||
})
|
||||
.catch(err => {
|
||||
if (err.message === 'Insufficient funds') {
|
||||
err.name = 'InsufficientFunds'
|
||||
}
|
||||
if (err.message === 'Insufficient funds') throw new E.InsufficientFundsError()
|
||||
throw err
|
||||
})
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue