diff options
| author | Adam Soltys <[email protected]> | 2018-11-29 19:57:44 +0000 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2018-11-29 19:57:47 +0000 |
| commit | 99db3f8894c42c417f681e09dd866ae269f25355 (patch) | |
| tree | 4c005bee7f58c0545d5d2aed3f3ce53b43724c04 | |
| parent | d050a9b7602518f369e87f6d23d57b5d612a4813 (diff) | |
| download | coinos-server-99db3f8894c42c417f681e09dd866ae269f25355.tar.gz coinos-server-99db3f8894c42c417f681e09dd866ae269f25355.zip | |
handle invoice error
| -rw-r--r-- | index.js | 9 |
1 files changed, 8 insertions, 1 deletions
@@ -419,7 +419,14 @@ const l = console.log }) app.post('/addInvoice', auth, async (req, res) => { - let invoice = await lnb.addInvoice({ value: req.body.amount }) + let err = m => res.status(500).send(m) + + let invoice + try { + invoice = await lnb.addInvoice({ value: req.body.amount }) + } catch (e) { + return err(e.message) + } await db.Payment.create({ user_id: req.user.id, |
