From 1fb0452d0cd7d6a9b534c58477447bd672cc76cd Mon Sep 17 00:00:00 2001 From: Matthew Wild Date: Tue, 16 Dec 2008 02:32:01 +0000 Subject: Protect loading of connlisteners, to catch errors --- net/connlisteners.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'net') diff --git a/net/connlisteners.lua b/net/connlisteners.lua index 8c9b163f..f027dfeb 100644 --- a/net/connlisteners.lua +++ b/net/connlisteners.lua @@ -47,7 +47,8 @@ end function get(name) local h = listeners[name]; if not h then - pcall(dofile, listeners_dir..name:gsub("[^%w%-]", "_").."_listener.lua"); + local ok, ret = pcall(dofile, listeners_dir..name:gsub("[^%w%-]", "_").."_listener.lua"); + if not ok then return nil, ret; end h = listeners[name]; end return h; -- cgit v1.2.3