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.
This commit is contained in:
Jan Philipp
2015-11-08 17:31:02 +01:00
parent e3a5c5a96a
commit affe3fde63

View File

@@ -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;
}