Merge pull request #1086 from siiky/fix/lam-231/stale-tx
refactor: add transaction ID to stale errors
This commit is contained in:
commit
f12bfec158
2 changed files with 2 additions and 2 deletions
|
|
@ -18,7 +18,7 @@ function atomic (machineTx, pi) {
|
|||
|
||||
return t.oneOrNone(sql, [machineTx.id])
|
||||
.then(row => {
|
||||
if (row && row.tx_version >= machineTx.txVersion) throw new E.StaleTxError('Stale tx')
|
||||
if (row && row.tx_version >= machineTx.txVersion) throw new E.StaleTxError({ txId: machineTx.id })
|
||||
|
||||
return t.any(sql2, [machineTx.id])
|
||||
.then(billRows => {
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ function atomic (tx, pi, fromClient) {
|
|||
.then(toObj)
|
||||
.then(oldTx => {
|
||||
const isStale = fromClient && oldTx && (oldTx.txVersion >= tx.txVersion)
|
||||
if (isStale) throw new E.StaleTxError('Stale tx')
|
||||
if (isStale) throw new E.StaleTxError({ txId: tx.id })
|
||||
|
||||
return preProcess(t, oldTx, tx, pi)
|
||||
.then(preProcessedTx => cashOutLow.upsert(t, oldTx, preProcessedTx))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue