feat: send InsufficientFundsError correct error code for machine logic
This commit is contained in:
parent
4876c5d1b6
commit
5add544ad7
1 changed files with 6 additions and 1 deletions
|
|
@ -17,7 +17,12 @@ function postTx (req, res, next) {
|
||||||
.then(tx => {
|
.then(tx => {
|
||||||
if (tx.errorCode) {
|
if (tx.errorCode) {
|
||||||
logger.error(tx.error)
|
logger.error(tx.error)
|
||||||
throw httpError(tx.error, 500)
|
switch (tx.errorCode) {
|
||||||
|
case 'InsufficientFundsError':
|
||||||
|
throw httpError(tx.error, 570)
|
||||||
|
default:
|
||||||
|
throw httpError(tx.error, 500)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return res.json(tx)
|
return res.json(tx)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue