REF: better logging

This commit is contained in:
Overtorment 2019-01-25 23:44:07 +00:00
parent 1df24d0e80
commit da37b5315d

View File

@ -200,10 +200,8 @@ router.post('/payinvoice', async function(req, res) {
} }
let inv = { payment_request: req.body.invoice, amt: info.num_satoshis }; // amt is used only for 'tip' invoices let inv = { payment_request: req.body.invoice, amt: info.num_satoshis }; // amt is used only for 'tip' invoices
try { try {
logger.log('/payinvoice', [req.id, 'before write', JSON.stringify(inv)]);
call.write(inv); call.write(inv);
} catch (Err) { } catch (Err) {
logger.log('/payinvoice', [req.id, 'exception', JSON.stringify(Err)]);
await lock.releaseLock(); await lock.releaseLock();
return errorLnd(res); return errorLnd(res);
} }
@ -271,7 +269,7 @@ router.get('/gettxs', async function(req, res) {
let txs = await u.getTxs(); let txs = await u.getTxs();
res.send(txs); res.send(txs);
} catch (Err) { } catch (Err) {
console.log(Err); logger.log('', [req.id, 'error:', Err]);
res.send([]); res.send([]);
} }
}); });
@ -291,7 +289,7 @@ router.get('/getuserinvoices', async function(req, res) {
res.send(invoices); res.send(invoices);
} }
} catch (Err) { } catch (Err) {
console.log(Err); logger.log('', [req.id, 'error:', Err]);
res.send([]); res.send([]);
} }
}); });