I don’t got a lot to say / type but does pcall not protect against all errors that could happen within the function?
I tried to wait for a child in a pcall so that if it inf yield the rest of my code doesn’t get affected but it seems to globally affect everything for some reason.
Example of how code was:
local Parent = path.to.parent
local Child = nil
local Succ, Err = pcall(function(...)
Child = Parent:WaitForChild("NonexistentChild")
end)
All it does is run the code, and return a status based on whether or not an error occurred. It doesn’t ignore waits. It will exit if an error occurs, but an infinite yield isn’t an error, because you could just be waiting for the part to load later.
If you want it to ignore the wait, run it on a new thread.
Don’t expect pcall to protect against all errors alone. The pcall is meant to be a logical structure to divert code from complete halt to handling the error. The thread continues without any failure after that.
My goal was to catch this tho…
It was like a GetChild method that would return the child by first using FindFirstChild then looping through children then the final wait for child