Merge pull request #1546 from chaotixkilla/fix-ciphertrace-error-handling

[LAM-561] Fix CT error handling and 0-conf usage
This commit is contained in:
Rafael Taranto 2023-06-01 14:30:50 +01:00 committed by GitHub
commit 7c25005247
2 changed files with 5 additions and 1 deletions

View file

@ -51,7 +51,7 @@ function diff (oldTx, newTx) {
if (oldTx && _.isEqualWith(nilEqual, oldTx[fieldKey], newTx[fieldKey])) return if (oldTx && _.isEqualWith(nilEqual, oldTx[fieldKey], newTx[fieldKey])) return
// We never null out an existing field // 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) { switch (fieldKey) {
case 'customerId': case 'customerId':

View file

@ -20,6 +20,10 @@ function postTx (req, res, next) {
switch (tx.errorCode) { switch (tx.errorCode) {
case 'InsufficientFundsError': case 'InsufficientFundsError':
throw httpError(tx.error, 570) throw httpError(tx.error, 570)
case 'scoreThresholdReached':
throw httpError(tx.error, 571)
case 'ciphertraceError':
throw httpError(tx.error, 572)
default: default:
throw httpError(tx.error, 500) throw httpError(tx.error, 500)
} }