Software /
code /
prosody
Changeset
4222:2805ebd57d7d
Merge 0.8->trunk.
author | Waqas Hussain <waqas20@gmail.com> |
---|---|
date | Wed, 02 Mar 2011 05:15:54 +0500 |
parents | 4219:bffce780999d (current diff) 4221:92594f1c7373 (diff) |
children | 4223:9fb6e8ec15ed |
files | |
diffstat | 2 files changed, 6 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/net/connlisteners.lua Tue Mar 01 06:14:03 2011 +0000 +++ b/net/connlisteners.lua Wed Mar 02 05:15:54 2011 +0500 @@ -13,8 +13,10 @@ local log = require "util.logger".init("connlisteners"); local tostring = tostring; -local dofile, pcall, error = - dofile, pcall, error +local dofile, xpcall, error = + dofile, xpcall, error + +local debug_traceback = debug.traceback; module "connlisteners" @@ -37,7 +39,7 @@ function get(name) local h = listeners[name]; if not h then - local ok, ret = pcall(dofile, listeners_dir..name:gsub("[^%w%-]", "_").."_listener.lua"); + local ok, ret = xpcall(function() dofile(listeners_dir..name:gsub("[^%w%-]", "_").."_listener.lua") end, debug_traceback); if not ok then log("error", "Error while loading listener '%s': %s", tostring(name), tostring(ret)); return nil, ret;