core/modulemanager.lua

changeset 713
2afd6d9e21cd
parent 710
56f6c115bc69
child 733
b1aedec00661
--- a/core/modulemanager.lua	Tue Jan 13 22:39:07 2009 +0500
+++ b/core/modulemanager.lua	Tue Jan 13 23:16:39 2009 +0500
@@ -164,6 +164,12 @@
 	local mod = modulemap[host] and modulemap[host][name];
 	if not mod then return nil, "module-not-loaded"; end
 
+	local _mod, err = loadfile(plugin_dir.."mod_"..name..".lua"); -- checking for syntax errors
+	if not _mod then
+		log("error", "Unable to load module '%s': %s", module_name or "nil", err or "nil");
+		return nil, err;
+	end
+
 	local saved;
 	if type(mod.module.save) == "function" then
 		local ok, err = pcall(mod.module.save)

mercurial