Improve transaction errors (#194)

* Improve transaction errors

* Fix standard styling errors
This commit is contained in:
Rafael Taranto 2018-10-27 09:22:36 -03:00 committed by Josh Harvey
parent 3cffbedd9a
commit b47af59a7f

View file

@ -141,8 +141,8 @@ function postTx (req, res, next) {
logger.warn('Harmless DB conflict, the query will be retried.')
return res.status(204).json({})
}
if (err instanceof E.StaleTxError) return res.status(409).json({})
if (err instanceof E.RatchetError) return res.status(409).json({})
if (err instanceof E.StaleTxError) return res.status(409).json({ errorType: 'stale' })
if (err instanceof E.RatchetError) return res.status(409).json({ errorType: 'ratchet' })
throw err
})