local F={}F.__index=F function F.new()return setmetatable({errorsToSimulate=0},F)end function F.addSimulatedErrors(g,F)assert(typeof(F)=="\110\117\109\098\101\114","\096\097\109\111\117\110\116\096 \109\117\115\116 \098\101 \097 \110\117\109\098\101\114")g.errorsToSimulate+=F end function F.simulateError(g,F)if g.errorsToSimulate>0 then g.errorsToSimulate-=1 error(string.format("\096\037\115\096 \114\101\106\101\099\116\101\100 \119\105\116\104 \101\114\114\111\114 \040\115\105\109\117\108\097\116\101\100 \101\114\114\111\114\041",F))end end return F
local SimulatedErrors = {}
SimulatedErrors.__index = SimulatedErrors

function SimulatedErrors.new()
	return setmetatable({
		errorsToSimulate = 0,
	}, SimulatedErrors)
end

function SimulatedErrors:addSimulatedErrors(amount)
	assert(typeof(amount) == "number", "`amount` must be a number")

	self.errorsToSimulate += amount
end

function SimulatedErrors:simulateError(method)
	if self.errorsToSimulate > 0 then
		self.errorsToSimulate -= 1

		error(string.format("`%s` rejected with error (simulated error)", method))
	end
end

return SimulatedErrors
