When runGame() completes without any errors, the error function will still run and say attempt to call a nil value. I tested this by just calling runGame() with no xpcall and I didn’t get any errors.
local function warnWithTracebackOnError()
xpcall(runGame(), function(err)
warn(tostring(err) .. "\n" .. debug.traceback())
--other code
end)
end
warnWithTracebackOnError()