util/xpcall.lua
author Kim Alvefur <zash@zash.se>
Tue, 27 Feb 2024 17:14:16 +0100
branch0.12
changeset 13449 360e05f33835
parent 9564 cfc7b2f7251e
child 12979 d10957394a3c
permissions -rw-r--r--
net.http.files: Validate argument to setup function Fixes error in #1765 by throwing an error earlier

local xpcall = xpcall;

if select(2, xpcall(function (x) return x end, function () end,  "test")) ~= "test" then
	xpcall = require"util.compat".xpcall;
end

return {
	xpcall = xpcall;
};