It does print out the errors and stuff but it does not prevent the error from breaking the whole module, sometimes it prevents it, and most of the time it doesn’t
** I’ve looked everywhere but I did not find a method that works 100%
local module = {}
module.function = function()
game.workspace.Nothing -- a fault on purpose to test it
end
function Handler(bool,data)
player.PlayerGui.ScreenGui.Debug.Text = data
end
local success, data = xpcall(module.function,handler)
print(success,data)
return module
local module = {
Player = game.Players.LocalPlayer
}
local success, data = pcall(function()
end)
print(success,data)
print("e")
function ErrorHandler(t,e)
module.Player.PlayerGui.ScreenGui.Debug.Text += t
end
return module
Actually, wait I just noticed that your solution doesn’t include the module.activate which I kinda need so is there any way? (if not then I’ll just roll with your solution up)
For anyone needing the actual code that works, It’s here
[/quote]
Thanks! I ended up xpcalling it inside of the function.
local module = {}
local Player = game.Player.LocalPlayer
Function = function()
local success, data = xpcall(function()
local test = game.workspace.Nothing -- a fault on purpose to test it
end,ErrorHandler)
end;
function Handler(bool,data)
print(data)
end
return module