local constant = "____________"
local hook do
hook = hookfunction(getrenv().xpcall, newcclosure(function(f, err)
if checkcaller() then
return hook(f, err)
end
if not islclosure(f) or not islclosure(err) then
return hook(f, err)
end
if not table.find(debug.getconstants(f), constant) then
return hook(f, err)
end
if typeof(debug.getupvalue(err, 2)) == "boolean" then
hookfunction(debug.getupvalue(err, 3), function()
return false
end)
end
return hook(f, err)
end))
end