From ea2473f0a3f746c1c7ec9878e28b85631458bc94 Mon Sep 17 00:00:00 2001 From: Ryan Blenis Date: Sun, 24 Nov 2019 21:29:13 -0500 Subject: [PATCH] Gracefully handle plugin versions check if one plugin causes an error --- pluginHandler.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/pluginHandler.js b/pluginHandler.js index bf8e2958..0c70e55d 100644 --- a/pluginHandler.js +++ b/pluginHandler.js @@ -260,11 +260,16 @@ module.exports.pluginHandler = function (parent) { parent.db.getPlugins(function(err, plugins) { var proms = []; plugins.forEach(function(curconf) { - proms.push(obj.getPluginConfig(curconf.configUrl)); + proms.push(obj.getPluginConfig(curconf.configUrl).catch(e => { return null; } )); }); var latestRet = []; Promise.all(proms).then(function(newconfs) { - newconfs.forEach(function(newconf) { + var nconfs = []; + // filter out config download issues + newconfs.forEach(function(nc) { + if (nc !== null) nconfs.push(nc); + }); + nconfs.forEach(function(newconf) { var curconf = null; plugins.forEach(function(conf) { if (conf.configUrl == newconf.configUrl) curconf = conf;