Comparison

core/modulemanager.lua @ 1330:baad431dabc5

modulemanager: Use module_name in log entry to fix 'error initialising module "nil"' error
author Matthew Wild <mwild1@gmail.com>
date Mon, 08 Jun 2009 13:25:10 +0100
parent 1328:0709c9564b1c
child 1334:6846c5cc9ce2
comparison
equal deleted inserted replaced
1329:599a058d3961 1330:baad431dabc5
126 setfenv(mod, pluginenv); 126 setfenv(mod, pluginenv);
127 if not hosts[host] then hosts[host] = { type = "component", host = host, connected = false, s2sout = {} }; end 127 if not hosts[host] then hosts[host] = { type = "component", host = host, connected = false, s2sout = {} }; end
128 128
129 local success, ret = pcall(mod); 129 local success, ret = pcall(mod);
130 if not success then 130 if not success then
131 log("error", "Error initialising module '%s': %s", name or "nil", ret or "nil"); 131 log("error", "Error initialising module '%s': %s", module_name or "nil", ret or "nil");
132 return nil, ret; 132 return nil, ret;
133 end 133 end
134 134
135 -- Use modified host, if the module set one 135 -- Use modified host, if the module set one
136 modulemap[api_instance.host][module_name] = pluginenv; 136 modulemap[api_instance.host][module_name] = pluginenv;