Add logging when transaction recording fails
This commit is contained in:
parent
fc5d04d2bc
commit
7ade66662f
1 changed files with 3 additions and 1 deletions
|
|
@ -56,8 +56,10 @@ async function init() {
|
||||||
await api.addTransactions(config.accountId, [transaction]);
|
await api.addTransactions(config.accountId, [transaction]);
|
||||||
console.log(`Successfully logged "${transaction.payee_name} - ¥${transaction.amount}"`);
|
console.log(`Successfully logged "${transaction.payee_name} - ¥${transaction.amount}"`);
|
||||||
return res.json({ result: 'success' });
|
return res.json({ result: 'success' });
|
||||||
} catch {
|
} catch (e) {
|
||||||
console.log('Transaction failed...');
|
console.log('Transaction failed...');
|
||||||
|
console.log(e);
|
||||||
|
console.log(e.message);
|
||||||
return res.json({ result: 'failure' });
|
return res.json({ result: 'failure' });
|
||||||
} finally {
|
} finally {
|
||||||
await api.shutdown();
|
await api.shutdown();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue