Skip to content

pcall

pcall(func, arg1, ...)

Calls the function func with the given arguments in “protected mode”. This means that any error inside func will not propagate; instead, pcall catches the error and returns a status code and the error message. If the call succeeds without errors, it returns true followed by any values returned by func. If there is an error, it returns false followed by the error message.