G.PCallError
From GMod Wiki
| Function | |
| Syntax |
PCallError( Function Func [, Var Args, ...] ) Where is this used? |
| Description: | |
| Utility function, returns false and automatically reports an error if there is one. | |
| Returns: | Boolean , Var , ... |
| Part of Library: | Global Functions |
| Realm: |
|
| BBCode Link: | [b][url=http://wiki.garrysmod.com/?title=G.PCallError]G.PCallError [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b] |
Examples
| Description | The function, as found in lua\includes\util.lua. |
|---|---|
| Used on | |
| Code | function PCallError( ... ) local errored, retval = pcall( unpack( arg ) ) if ( !errored ) then ErrorNoHalt( retval ) return false, retval end return true, retval end |
| Output | Boolean , Var |