Hey developers, does erroring in RemoteEvent or RemoteFunction handlers can stop the script handles the event? Let’s say there’s script A, it handles RemoteA and the script errors if the passed argument is incorrect. And Client A fires RemoteA and passed the wrong arguments. Will Script A stop running or just continue running?
Also if the event or function handlers yield, will the script proceed or yield.
I wonder this applies the same to Bindables too.
Any help will be appreciated. If you cannot understand what I am talking, I apologize in advance.
Callback functions connected to RBXScriptSignal objects run in an isolated stack (when invoked by the firing of that RBXScriptSignal object) meaning that thrown/raised errors will never be propogated to the main thread of execution, you can explicitly test this by doing the following in a server script.
local Game = game
local Players = Game:GetService("Players")
local function OnPlayerAdded(Player)
print("Hello world!")
error() --Explicitly throw/raise an error inside the callback function connected to the player's 'PlayerAdded' event.
end
Players.PlayerAdded:Connect(OnPlayerAdded)
task.wait(5) --Wait some length of time.
print("Test.") --Unaffected by the error.