Executes a function in protected mode. When running a function in protected mode, any errors do not propagate beyond the function (i.e. they do not stop all execution and call the default error handler).
See also Lua library functions.
Signature:
status,
...
=
pcall(f,
...)
Arguments:
f
- A function (function
)...
- Arguments to be passed to the function (list
)
Returns:
status
- True if the function succeeded without errors; false otherwise (boolean
)...
- Ifstatus
isfalse
, the error message produced by the function; ifstatus
istrue
, the return values from the function (list or string
)
This function is defined in the Lua standard libraries