I need a function to run each time i receive a "image failed to load : request failed" exception. Usually on other scripting languages i would use try-catch. Is there something similar on roblox? i couldn't find any answer online.
COMMUNITY QUESTION
How do i detect an exception in roblox?
1 answer
game:GetService("ScriptContext").Error:Connect(function(msg,stack,source)
print(msg,stack,source.Name)
end)
Catches every error.
1 comment
0
Does it only catch errors in the script you put the code in?
This discussion is preserved as it was. New answers, comments, and votes are closed.

1 comment
Lua does not have exceptions. But you can use pcall to check if a function executes correctly.