From bf6ec8880796f3aa60a75196704f35de69424ca9 Mon Sep 17 00:00:00 2001 From: danbulant Date: Fri, 21 Feb 2020 16:42:50 +0100 Subject: [PATCH] Stop execution of function after rejection --- modules/requests.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/requests.js b/modules/requests.js index f2dfcc1..961658c 100644 --- a/modules/requests.js +++ b/modules/requests.js @@ -10,7 +10,7 @@ module.exports = (path, options = { method: "GET" }) => { } else if(path.startsWith("https://")){ var handler = https; } else { - rej(Error("Unsupported protocol")); + return rej(Error("Unsupported protocol")); } handler.get(path, options, (resp) => {