Stop execution of function after rejection

This commit is contained in:
danbulant 2020-02-21 16:42:50 +01:00
parent 674fb26a3b
commit bf6ec88807

View file

@ -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) => {