feat: sendCoins error handling
This commit is contained in:
parent
f37a73f983
commit
46f6879108
1 changed files with 8 additions and 1 deletions
|
|
@ -171,7 +171,14 @@ function sendCoins (account, tx, settings, operatorId) {
|
|||
return sendFundsOnChain(wallet.id, toAddress, cryptoAtoms, account.authToken)
|
||||
})
|
||||
.then(result => {
|
||||
return result
|
||||
switch (result.status) {
|
||||
case 'ALREADY_PAID':
|
||||
throw new Error('Transaction already exists!')
|
||||
case 'FAILURE':
|
||||
throw new Error('Transaction failed!')
|
||||
default:
|
||||
return '<galoy transaction>'
|
||||
}
|
||||
})
|
||||
.catch(err => {
|
||||
throw err
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue