catch errors

This commit is contained in:
Daniel Lugo 2020-09-28 11:56:30 -04:00
parent 71c239d432
commit 288ba30a16

View file

@ -3086,6 +3086,7 @@ module.exports = async (
}) })
ap.post('/api/lnd/cb/:methodName', (req, res) => { ap.post('/api/lnd/cb/:methodName', (req, res) => {
try {
const { lightning } = LightningServices.services const { lightning } = LightningServices.services
const { methodName } = req.params const { methodName } = req.params
const args = req.body const args = req.body
@ -3103,5 +3104,14 @@ module.exports = async (
}) })
} }
}) })
} catch (err) {
logger.warn(`Error inside api cb:`)
logger.error(err)
logger.error(err.message)
return res.status(500).json({
errorMessage: err.message
})
}
}) })
} }