local function T(T,x)return xpcall(T,function(T)if not x then warn(tostring(T)..("\n"..debug.traceback()))end return false,T end)end function SafeSpawn.new(x,h)local y,Q=T(coroutine.wrap(x),h)if not y and not h then warn(Q)end return y,Q end return SafeSpawn

local function warnWithTracebackOnError(func, shouldNotWarn)
	return xpcall(func, function(err)
		if not shouldNotWarn then
			warn(tostring(err) .. "\n" .. debug.traceback())
		end
		return false, err
	end)
end

function SafeSpawn.new(func, shouldNotWarn)
	local success, err = warnWithTracebackOnError(coroutine.wrap(func), shouldNotWarn)
	if not success and not shouldNotWarn then
		warn(err)
	end
	return success, err
end

return SafeSpawn
