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 | 949e78e2e18325729f7a60c688da853e89b43b8a (patch) | |
tree | 6106a6585412d1e27a8eb8511b8de2da523e802f /net | |
parent | f17b76ce487a90598c67f1e43e451d45f3e3a946 (diff) | |
download | prosody-949e78e2e18325729f7a60c688da853e89b43b8a.tar.gz prosody-949e78e2e18325729f7a60c688da853e89b43b8a.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); |