aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2008-12-16 02:32:01 +0000
committerMatthew Wild <mwild1@gmail.com>2008-12-16 02:32:01 +0000
commit1fb0452d0cd7d6a9b534c58477447bd672cc76cd (patch)
tree8e8acd3d3931cff3150f1bd591e4b21c977a9bb8
parent450c6ef7fc79aeca30f65a2e3f2c242e26353257 (diff)
downloadprosody-1fb0452d0cd7d6a9b534c58477447bd672cc76cd.tar.gz
prosody-1fb0452d0cd7d6a9b534c58477447bd672cc76cd.zip
Protect loading of connlisteners, to catch errors
-rw-r--r--net/connlisteners.lua3
1 files changed, 2 insertions, 1 deletions
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;