aboutsummaryrefslogtreecommitdiffstats
path: root/net/server_epoll.lua
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2020-01-05 02:29:31 +0100
committerKim Alvefur <zash@zash.se>2020-01-05 02:29:31 +0100
commit25ce791b75a3f6facb3c7c3d48df4a86805f997f (patch)
tree6106a6585412d1e27a8eb8511b8de2da523e802f /net/server_epoll.lua
parent71138a9fd9d1b1e5767409be50d1547359e0d186 (diff)
downloadprosody-25ce791b75a3f6facb3c7c3d48df4a86805f997f.tar.gz
prosody-25ce791b75a3f6facb3c7c3d48df4a86805f997f.zip
net.server_epoll: Collect full traceback from errors in listeners
Diffstat (limited to 'net/server_epoll.lua')
-rw-r--r--net/server_epoll.lua4
1 files changed, 3 insertions, 1 deletions
diff --git a/net/server_epoll.lua b/net/server_epoll.lua
index 4ad142ce..ff69bfbf 100644
--- a/net/server_epoll.lua
+++ b/net/server_epoll.lua
@@ -13,6 +13,7 @@ local pcall = pcall;
local type = type;
local next = next;
local pairs = pairs;
+local traceback = debug.traceback;
local logger = require "util.logger";
local log = logger.init("server_epoll");
local socket = require "socket";
@@ -25,6 +26,7 @@ local inet = require "util.net";
local inet_pton = inet.pton;
local _SOCKETINVALID = socket._SOCKETINVALID or -1;
local new_id = require "util.id".medium;
+local xpcall = require "util.xpcall".xpcall;
local poller = require "util.poll"
local EEXIST = poller.EEXIST;
@@ -175,7 +177,7 @@ function interface:on(what, ...)
-- self:debug("Missing listener 'on%s'", what); -- uncomment for development and debugging
return;
end
- local ok, err = pcall(listener, self, ...);
+ local ok, err = xpcall(listener, traceback, self, ...);
if not ok then
if cfg.fatal_errors then
self:debug("Closing due to error calling on%s: %s", what, err);