Skip to content

Commit

Permalink
Swap back to xpcall
Browse files Browse the repository at this point in the history
  • Loading branch information
Azilroka committed May 10, 2023
1 parent 8c20f8b commit ce4e3ff
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion AddOnSkins/Core/Core.lua
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ local pairs, ipairs, type, pcall = pairs, ipairs, type, pcall
local floor, print, format, strlower, strmatch, strlen = floor, print, format, strlower, strmatch, strlen
local sort, tinsert = sort, tinsert

local geterrorhandler = geterrorhandler
local IsAddOnLoaded, C_Timer = IsAddOnLoaded, C_Timer

AS.SkinErrors = {}
Expand Down Expand Up @@ -170,10 +171,15 @@ function AS:RunPreload(addonName)
end
end


local function errorhandler(err)
return geterrorhandler()(err)
end

function AS:CallSkin(addonName, func, event, ...)
if (AS:CheckOption('SkinDebug')) then
local args = {...}
securecallfunction(function() func(self, event, unpack(args)) end)
xpcall(function() func(self, event, unpack(args)) end, errorhandler)
else
local pass = pcall(func, self, event, ...)
if not pass then
Expand Down

0 comments on commit ce4e3ff

Please sign in to comment.