Software /
code /
prosody
Changeset
624:04fe1a00aa16
Protect loading of connlisteners, to catch errors
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Tue, 16 Dec 2008 02:32:01 +0000 |
parents | 623:5af5a64a729f |
children | 625:cad4dcfbf295 |
files | net/connlisteners.lua |
diffstat | 1 files changed, 2 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/net/connlisteners.lua Tue Dec 16 02:30:24 2008 +0000 +++ b/net/connlisteners.lua Tue Dec 16 02:32:01 2008 +0000 @@ -47,7 +47,8 @@ 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;