aboutsummaryrefslogtreecommitdiffstats
path: root/core/modulemanager.lua
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2018-10-26 19:32:00 +0100
committerMatthew Wild <mwild1@gmail.com>2018-10-26 19:32:00 +0100
commit9b5c6c4d9de2d32a3a0391e6d06a178f21dbb807 (patch)
tree0eff02506e6364d1dcb5c71b2edaacd6662ffe20 /core/modulemanager.lua
parent3bc2c02797799a0e71c4a04dc810d2d683271c42 (diff)
downloadprosody-9b5c6c4d9de2d32a3a0391e6d06a178f21dbb807.tar.gz
prosody-9b5c6c4d9de2d32a3a0391e6d06a178f21dbb807.zip
Many things: switch from hacky multi-arg xpcall implementations to a standard util.xpcall
Diffstat (limited to 'core/modulemanager.lua')
-rw-r--r--core/modulemanager.lua9
1 files changed, 2 insertions, 7 deletions
diff --git a/core/modulemanager.lua b/core/modulemanager.lua
index 81c28aa0..63b5e177 100644
--- a/core/modulemanager.lua
+++ b/core/modulemanager.lua
@@ -18,18 +18,13 @@ local api = require "core.moduleapi"; -- Module API container
local prosody = prosody;
local hosts = prosody.hosts;
-local xpcall = xpcall;
+local xpcall = require "util.xpcall".xpcall;
local setmetatable, rawget = setmetatable, rawget;
local ipairs, pairs, type, tostring, t_insert = ipairs, pairs, type, tostring, table.insert;
local debug_traceback = debug.traceback;
local select = select;
local unpack = table.unpack or unpack; --luacheck: ignore 113
-local pcall = function(f, ...)
- local n = select("#", ...);
- local params = {...};
- return xpcall(function() return f(unpack(params, 1, n)) end, function(e) return tostring(e).."\n"..debug_traceback(); end);
-end
local autoload_modules = {prosody.platform, "presence", "message", "iq", "offline", "c2s", "s2s", "s2s_auth_certs"};
local component_inheritable_modules = {"tls", "saslauth", "dialback", "iq", "s2s"};
@@ -183,7 +178,7 @@ local function do_load_module(host, module_name, state)
api_instance.path = err;
modulemap[host][module_name] = pluginenv;
- local ok, err = pcall(mod);
+ local ok, err = xpcall(mod, debug.traceback);
if ok then
-- Call module's "load"
if module_has_method(pluginenv, "load") then