Closed
Description
Take the following code:
local function loop()
while true do
task.defer()
print("hi")
end
end
local function otherloop()
while true do
task.defer()
if math.random(1, 2) == 1 then
error("oops")
end
end
end
coroutine.resume(coroutine.create(loop))
coroutine.resume(coroutine.create(otherloop))
This code, unintuitively, will exit the process. This is because when the scheduler encounters any error, even one not on the main thread, it will exit the process.