pcall instead xpcall

This commit is contained in:
Bunny67
2020-06-06 19:19:18 +03:00
parent 32dda9febe
commit 5b6330807c
5 changed files with 203 additions and 72 deletions
+8 -2
View File
@@ -283,7 +283,10 @@ end
local function RunCode(self, func)
if func and not WeakAuras.IsOptionsOpen() then
WeakAuras.ActivateAuraEnvironment(self.id, self.cloneId, self.state, self.states);
xpcall(func, geterrorhandler());
local ok, ret = pcall(func);
if not ok then
geterrorhandler()(ret)
end
WeakAuras.ActivateAuraEnvironment(nil);
end
end
@@ -304,7 +307,10 @@ local function UpdatePosition(self)
local yOffset = self.yOffset + (self.yOffsetAnim or 0) + (self.yOffsetRelative or 0)
self:RealClearAllPoints();
self:SetPoint(self.anchorPoint, self.relativeTo, self.relativePoint, xOffset, yOffset);
local ok, ret = pcall(self.SetPoint, self, self.anchorPoint, self.relativeTo, self.relativePoint, xOffset, yOffset);
if not ok then
geterrorhandler()(ret)
end
end
local function ResetPosition(self)