Errors are tables instead of strings on SC3 test version.
Wojbie opened this issue ยท 5 comments
Minecraft Version
1.19.x
Version
1.102.2 - SC3 version
Details
Reporting it in case whatever test code we are running has some extras.
Errors generated seem to be a table instead of strings:
local ok, err = pcall(parallel.waitForAll,
function() sleep(10) end,
function() sleep(1) os.queueEvent("terminate") end
)
if type(err) == "table" then
for i,k in pairs(err) do print(i,k) end
print(err == err.root_cause)
end
print(type(err), err)
Sorry I haven't checked but are we still running on the build merged in SwitchCraftCC/SwitchCraft3#36 and if so was it created before 65f6adc was pushed? We might just need to bump to 1.103.1
I'm assuming this has been reported because it was breaking someone's program? Ughr. I was really hoping it wasn't going to happen (people shouldn't be depending on the format of error messages!), but it was always going to be a risk.
This is why we can't have nice things :(.
I'm assuming this has been reported because it was breaking someone's program? Ughr. I was really hoping it wasn't going to happen (people shouldn't be depending on the format of error messages!), but it was always going to be a risk.
We received at least two reports from players who noticed that their code to detect terminations via
local ok,err == pcall(something)
if not ok and err == "Terminated" then --stuff
stopped working. Doing tostring(err) == "Terminated"
obviously solves this, but unfortunately this is a breaking change :(