# HG changeset patch # User Matthew Wild # Date 1540579982 -3600 # Node ID 732314eb325825500c0b6fa6b5033e8b7a1e6025 # Parent acf74ad0b79567b0bffe04eb5339f14c2bf869ae modulemanager: Fix issues introduced in previous commit acf74ad0b795 [thanks luacheck, scansion] diff -r acf74ad0b795 -r 732314eb3258 core/modulemanager.lua --- a/core/modulemanager.lua Fri Oct 26 19:32:00 2018 +0100 +++ b/core/modulemanager.lua Fri Oct 26 19:53:02 2018 +0100 @@ -19,12 +19,9 @@ local hosts = prosody.hosts; local xpcall = require "util.xpcall".xpcall; +local debug_traceback = debug.traceback; 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 ipairs, pairs, type, t_insert = ipairs, pairs, type, table.insert; local autoload_modules = {prosody.platform, "presence", "message", "iq", "offline", "c2s", "s2s", "s2s_auth_certs"}; local component_inheritable_modules = {"tls", "saslauth", "dialback", "iq", "s2s"}; @@ -178,7 +175,7 @@ api_instance.path = err; modulemap[host][module_name] = pluginenv; - local ok, err = xpcall(mod, debug.traceback); + local ok, err = xpcall(mod, debug_traceback); if ok then -- Call module's "load" if module_has_method(pluginenv, "load") then @@ -320,7 +317,7 @@ function call_module_method(module, method, ...) local f = rawget(module.module, method); if type(f) == "function" then - return pcall(f, ...); + return xpcall(f, debug_traceback, ...); else return false, "no-such-method"; end