aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2024-02-28 04:46:41 +0000
committerAdam Soltys <[email protected]>2024-02-28 04:46:41 +0000
commit8276c872ae2bcff564bafe4881634f3488c4d861 (patch)
tree8e5d186b403fd4a6da43a3d15bf82cf7abe109ec
parent495f9b8373120ed1d3b6076e1ca9ac2cbdb8f40c (diff)
downloadcoinos-server-8276c872ae2bcff564bafe4881634f3488c4d861.tar.gz
coinos-server-8276c872ae2bcff564bafe4881634f3488c4d861.zip
catch price error
-rw-r--r--routes/items.js4
1 files changed, 4 insertions, 0 deletions
diff --git a/routes/items.js b/routes/items.js
index a7fa1567..9b6314fa 100644
--- a/routes/items.js
+++ b/routes/items.js
@@ -25,6 +25,7 @@ export default {
},
async create({ body: item, user: { id } }, res) {
+ try {
if (!item.id) {
item.id = v4();
await db.lPush(`${id}:items`, item.id);
@@ -36,6 +37,9 @@ export default {
await s(`item:${item.id}`, item);
res.send(item);
+ } catch (e) {
+ bail(res, e.message);
+ }
},
async del({ body: { item }, user: { id } }, res) {