Diff

net/connlisteners.lua @ 2076:de2ae849b0b3

net.connlisteners: Log an error when a listener fails to load.
author Waqas Hussain <waqas20@gmail.com>
date Thu, 12 Nov 2009 13:34:38 +0500
parent 2036:0f9c121713e1
child 2104:466bd2cac62a
child 2923:b7049746bd29
line wrap: on
line diff
--- a/net/connlisteners.lua	Thu Nov 12 13:33:46 2009 +0500
+++ b/net/connlisteners.lua	Thu Nov 12 13:34:38 2009 +0500
@@ -38,7 +38,10 @@
 	local h = listeners[name];
 	if not h then
 		local ok, ret = pcall(dofile, listeners_dir..name:gsub("[^%w%-]", "_").."_listener.lua");
-		if not ok then return nil, ret; end
+		if not ok then
+			log("error", "Error while loading listener '%s': %s", tostring(name), tostring(ret));
+			return nil, ret;
+		end
 		h = listeners[name];
 	end
 	return h;