diff options
author | Matthew Wild <mwild1@gmail.com> | 2008-12-16 02:32:01 +0000 |
---|---|---|
committer | Matthew Wild <mwild1@gmail.com> | 2008-12-16 02:32:01 +0000 |
commit | 1fb0452d0cd7d6a9b534c58477447bd672cc76cd (patch) | |
tree | 8e8acd3d3931cff3150f1bd591e4b21c977a9bb8 /net/connlisteners.lua | |
parent | 450c6ef7fc79aeca30f65a2e3f2c242e26353257 (diff) | |
download | prosody-1fb0452d0cd7d6a9b534c58477447bd672cc76cd.tar.gz prosody-1fb0452d0cd7d6a9b534c58477447bd672cc76cd.zip |
Protect loading of connlisteners, to catch errors
Diffstat (limited to 'net/connlisteners.lua')
-rw-r--r-- | net/connlisteners.lua | 3 |
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; |