From affe3fde63c8d0b2c4f6097a83787e63f9c90487 Mon Sep 17 00:00:00 2001 From: Jan Philipp Date: Sun, 8 Nov 2015 17:31:02 +0100 Subject: [PATCH] Provide and output proper existing error message If the found plugin / package does not fulfill some specs (i.e. does not contain the keyword `homebridge-plugin`), it will be rejected with an error. Without that change nobody will be notified WHY the plugin has been rejected/skipped. --- lib/plugin.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/plugin.js b/lib/plugin.js index 31669a6..1d89238 100644 --- a/lib/plugin.js +++ b/lib/plugin.js @@ -176,6 +176,10 @@ Plugin.installed = function() { pjson = Plugin.loadPackageJSON(pluginPath); } catch (err) { + if (name.substring(0,11) === 'homebridge-') { + // show warning only if module starts with prefix + log.warn("Warning: skipping plugin found at '" + pluginPath + "' because of: " + err.message); + } // swallow error and skip this module continue; }