Diff

core/modulemanager.lua @ 229:01bd24ea488d

We now fail if modules fail to load at startup.
author Waqas Hussain <waqas20@gmail.com>
date Sun, 09 Nov 2008 04:26:25 +0500
parent 218:1263896ab2f1
child 300:0ebf2ef5124e
line wrap: on
line diff
--- a/core/modulemanager.lua	Sun Nov 09 03:33:38 2008 +0500
+++ b/core/modulemanager.lua	Sun Nov 09 04:26:25 2008 +0500
@@ -68,7 +68,7 @@
 	local mod, err = loadfile("plugins/mod_"..name..".lua");
 	if not mod then
 		log("error", "Unable to load module '%s': %s", name or "nil", err or "nil");
-		return;
+		return nil, err;
 	end
 	
 	local pluginenv = setmetatable({ module = { name = name } }, { __index = modulehelpers });
@@ -77,8 +77,9 @@
 	local success, ret = pcall(mod);
 	if not success then
 		log("error", "Error initialising module '%s': %s", name or "nil", ret or "nil");
-		return;
+		return nil, err;
 	end
+	return true;
 end
 
 function handle_stanza(origin, stanza)