diff options
author | Kim Alvefur <zash@zash.se> | 2020-01-05 02:29:31 +0100 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2020-01-05 02:29:31 +0100 |
commit | 25ce791b75a3f6facb3c7c3d48df4a86805f997f (patch) | |
tree | 6106a6585412d1e27a8eb8511b8de2da523e802f /net | |
parent | 71138a9fd9d1b1e5767409be50d1547359e0d186 (diff) | |
download | prosody-25ce791b75a3f6facb3c7c3d48df4a86805f997f.tar.gz prosody-25ce791b75a3f6facb3c7c3d48df4a86805f997f.zip |
net.server_epoll: Collect full traceback from errors in listeners
Diffstat (limited to 'net')
-rw-r--r-- | net/server_epoll.lua | 4 |
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); |