From f5f6460b2eab9d8cdd1de3231a5770bedd7e34f9 Mon Sep 17 00:00:00 2001 From: Matthew Wild Date: Fri, 26 Oct 2018 19:32:00 +0100 Subject: Many things: switch from hacky multi-arg xpcall implementations to a standard util.xpcall --- util/async.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'util/async.lua') diff --git a/util/async.lua b/util/async.lua index 4d9f159f..20397785 100644 --- a/util/async.lua +++ b/util/async.lua @@ -1,6 +1,7 @@ local logger = require "util.logger"; local log = logger.init("util.async"); local new_id = require "util.id".short; +local xpcall = require "util.xpcall".xpcall; local function checkthread() local thread, main = coroutine.running(); @@ -27,7 +28,7 @@ local function call_watcher(runner, watcher_name, ...) return false; end runner:log("debug", "Calling '%s' watcher", watcher_name); - local ok, err = pcall(watcher, runner, ...); -- COMPAT: Switch to xpcall after Lua 5.1 + local ok, err = xpcall(watcher, debug.traceback, runner, ...); if not ok then runner:log("error", "Error in '%s' watcher: %s", watcher_name, err); return nil, err; -- cgit v1.2.3