From 9bc2b463ec29964bb3463cdeca2a64da3bf5a651 Mon Sep 17 00:00:00 2001 From: XeonSquared Date: Mon, 4 Sep 2017 02:36:05 +1000 Subject: [PATCH] made spawn() log errors --- modules/base/header.lua | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/modules/base/header.lua b/modules/base/header.lua index b15e3b1..45688c8 100644 --- a/modules/base/header.lua +++ b/modules/base/header.lua @@ -12,7 +12,10 @@ do -- so local works _G.cT,sbt,C,T,io = 0,{},coroutine,table,io -- currentTask,sandboxTable function _G.spawn(n,f,e) tT[nP] = {} - tT[nP].c = coroutine.create(f) + local function nf() + log(xpcall(f)) + end + tT[nP].c = coroutine.create(nf) tT[nP].n = n tT[nP].p = cT or -1 if tT[cT] then