aboutsummaryrefslogtreecommitdiffstats
path: root/core/modulemanager.lua
diff options
context:
space:
mode:
Diffstat (limited to 'core/modulemanager.lua')
-rw-r--r--core/modulemanager.lua12
1 files changed, 10 insertions, 2 deletions
diff --git a/core/modulemanager.lua b/core/modulemanager.lua
index f160521f..082dcbb8 100644
--- a/core/modulemanager.lua
+++ b/core/modulemanager.lua
@@ -38,7 +38,8 @@ local _G = _G;
module "modulemanager"
-local api = {}; -- Module API container
+api = {};
+local api = api; -- Module API container
local modulemap = { ["*"] = {} };
@@ -134,6 +135,13 @@ function load(host, module_name, config)
return nil, ret;
end
+ if module_has_method(pluginenv, "load") then
+ local ok, err = call_module_method(pluginenv, "load");
+ if (not ok) and err then
+ log("warn", "Error loading module '%s' on '%s': %s", module_name, host, err);
+ end
+ end
+
-- Use modified host, if the module set one
modulemap[api_instance.host][module_name] = pluginenv;
@@ -190,7 +198,7 @@ function reload(host, name, ...)
local _mod, err = pluginloader.load_code(name); -- checking for syntax errors
if not _mod then
- log("error", "Unable to load module '%s': %s", module_name or "nil", err or "nil");
+ log("error", "Unable to load module '%s': %s", name or "nil", err or "nil");
return nil, err;
end