Global/ProtectedCall

From Garry's Mod
(Difference between revisions)
Jump to: navigation, search
 
Line 5: Line 5:
 
|Realm=Shared
 
|Realm=Shared
 
|IsClass=No
 
|IsClass=No
|Name=ProtectedCall
 
|Parent=Global
 
 
}}
 
}}
 
{{Arg
 
{{Arg
Line 15: Line 13:
 
{{Ret
 
{{Ret
 
|type=boolean
 
|type=boolean
|desc=Were there any errors or not
+
|desc=Whether the function executed successfully or not
 
}}
 
}}

Latest revision as of 13:00, 20 October 2019

 ProtectedCall( )

Description

Runs a function without stopping the whole script on error.

This function is similar to pcall and xpcall except the errors are still printed and sent to the error handler (i.e. sent to server console if clientside and GM:OnLuaError called).

Arguments

function func

Function to run

Returns

boolean

Whether the function executed successfully or not
Personal tools
Navigation