As I continue to optimise my scripts, I've heard about a function which deals with errors within a script in the event that an error does occur it will continue. I understand that this is commonly used for data retrieval using at async function but can someone explain this to me?
Well the failsave is the built in pcall function which wraps everything inside it in a protected bit of code. If the code inside it errors it will return two thinks, a success value (boolean) and a error message(string) and if it is successful, it runs and returns a success value.
local success, Error = pcall(function() pprint("test")--errors end) if success then print("yay",Error)--"yay", false else print(Error) end