From 15ba93bb576eb108c0b019902ecc680dcf23fd73 Mon Sep 17 00:00:00 2001 From: Keerthi Niranjan Date: Mon, 31 Jul 2017 20:55:19 +0530 Subject: [PATCH] Added return instead of console --- js/search/search.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/js/search/search.js b/js/search/search.js index d37e7f90..6bc1df23 100644 --- a/js/search/search.js +++ b/js/search/search.js @@ -175,12 +175,11 @@ class Search { try { data = JSON.parse(result); if (data.status === 'OK') { - console.log('Successful') - } else { - console.log("Failed to validate index data folder"); + return data; } + return new Error('Unable validate index folder') } catch (err) { - throw err; + throw (err) } } }