Skip to content

Commit

Permalink
Merge pull request #1546 from chaotixkilla/fix-ciphertrace-error-hand…
Browse files Browse the repository at this point in the history
…ling

[LAM-561] Fix CT error handling and 0-conf usage
  • Loading branch information
RafaelTaranto authored Jun 1, 2023
2 parents 64c7434 + 9b21c03 commit 34b448d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/cash-out/cash-out-low.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ function diff (oldTx, newTx) {
if (oldTx && _.isEqualWith(nilEqual, oldTx[fieldKey], newTx[fieldKey])) return

// We never null out an existing field
if (oldTx && _.isNil(newTx[fieldKey])) return
if (oldTx && _.isNil(newTx[fieldKey])) return updatedTx[fieldKey] = oldTx[fieldKey]

switch (fieldKey) {
case 'customerId':
Expand Down
4 changes: 4 additions & 0 deletions lib/routes/txRoutes.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ function postTx (req, res, next) {
switch (tx.errorCode) {
case 'InsufficientFundsError':
throw httpError(tx.error, 570)
case 'scoreThresholdReached':
throw httpError(tx.error, 571)
case 'ciphertraceError':
throw httpError(tx.error, 572)
default:
throw httpError(tx.error, 500)
}
Expand Down

0 comments on commit 34b448d

Please sign in to comment.