Merge pull request #1859 from RafaelTaranto/fix/cash-out-handling

LAM-1430 fix: keep handling non error code as errors
This commit is contained in:
Rafael Taranto 2025-05-23 16:05:07 +01:00 committed by GitHub
commit 33a310779b

View file

@ -53,7 +53,12 @@ function getTx(req, res, next) {
return helpers
.fetchStatusTx(req.params.id, req.query.status)
.then(r => res.json(r))
.catch(next)
.catch(err => {
if (err.name === 'HTTPError') {
return res.status(err.code).send(err.message)
}
next(err)
})
}
return next(httpError('Not Found', 404))