fix: ct error handling, v8.5.0-beta.2 (#1548)
* fix: response tx for machine update requests fix: CT error handling * fix: wrong error code * chore: version v8.5.0-beta.2 --------- Co-authored-by: Sérgio Salgado <sergiodiassalgado@gmail.com>
This commit is contained in:
parent
06f534fa48
commit
41584e9f4b
4 changed files with 7 additions and 3 deletions
|
|
@ -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':
|
||||||
|
|
|
||||||
|
|
@ -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)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
2
package-lock.json
generated
2
package-lock.json
generated
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "lamassu-server",
|
"name": "lamassu-server",
|
||||||
"version": "8.5.0-beta.1",
|
"version": "8.5.0-beta.2",
|
||||||
"lockfileVersion": 1,
|
"lockfileVersion": 1,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
"name": "lamassu-server",
|
"name": "lamassu-server",
|
||||||
"description": "bitcoin atm client server protocol module",
|
"description": "bitcoin atm client server protocol module",
|
||||||
"keywords": [],
|
"keywords": [],
|
||||||
"version": "8.5.0-beta.1",
|
"version": "8.5.0-beta.2",
|
||||||
"license": "Unlicense",
|
"license": "Unlicense",
|
||||||
"author": "Lamassu (https://lamassu.is)",
|
"author": "Lamassu (https://lamassu.is)",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue