aboutsummaryrefslogtreecommitdiffstats
path: root/routes
diff options
context:
space:
mode:
Diffstat (limited to 'routes')
-rw-r--r--routes/payments.js4
1 files changed, 4 insertions, 0 deletions
diff --git a/routes/payments.js b/routes/payments.js
index 425561f1..c13f7bec 100644
--- a/routes/payments.js
+++ b/routes/payments.js
@@ -232,6 +232,7 @@ export default {
},
async take({ body: { name, amount, hash }, user }, res) {
+ try {
amount = parseInt(amount);
if (amount < 0) fail("Invalid amount");
@@ -258,6 +259,9 @@ export default {
await db.lPush(`pot:${name}:payments`, hash);
res.send({ payment });
+ } catch(e) {
+ bail(res, e.message);
+ }
},
async bitcoin({ body: { txid, wallet } }, res) {