xpcall(func, err_handler, arg1, ...)
Calls
funcin “protected mode”. This means that any error insidefuncis not propagated; instead,xpcallcatches the error, calls the “error handler” function passed to it, then returns back to the caller. If the first return value is true, the function call succeeded with no errors and the other return values will be the return values from the function. If the first return value is false, the second one will be the error message.