From 51c2ee3eccff9d4d3162222f1c0139fe71fe3e82 Mon Sep 17 00:00:00 2001 From: Wingysam Date: Thu, 22 Nov 2018 09:30:21 -0500 Subject: [PATCH] give error to user if url to name failed --- routes/wishlist/index.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/routes/wishlist/index.js b/routes/wishlist/index.js index d23c021..7ec7ea7 100644 --- a/routes/wishlist/index.js +++ b/routes/wishlist/index.js @@ -46,7 +46,9 @@ module.exports = (db) => { let productData; try { if (isUrl) productData = await getProductName(req.body.itemUrlOrName, config.proxyServer); - } catch (err) {} + } catch (err) { + req.flash('error', err.toString()); + } item.name = (productData ? productData.name : req.body.itemUrlOrName); item.addedBy = req.user._id; item.pledgedBy = (req.user._id === req.params.user ? undefined : req.user._id);