Quantcast

When catching an error give some feedback regarding which line and segment was disabled.

Scott Sibley [07-09-11 - 18:53]
When catching an error give some feedback regarding which line and segment was disabled.
Filename
Localization/enUS.lua
StarTip.lua
diff --git a/Localization/enUS.lua b/Localization/enUS.lua
index ad4c988..24874e9 100644
--- a/Localization/enUS.lua
+++ b/Localization/enUS.lua
@@ -4,6 +4,7 @@ if not L then return end

 L["Welcome to "] = true
 L[" Type /startip to open config. Alternatively you could press escape and choose the addons menu. Or you can choose to show a minimap icon. You can turn off this message under Settings."] = true
+L["StarTip disabled a tooltip line named %s due to an error in the line's %s segment."] = true
 L["None"] = true
 L["Ctrl"] = true
 L["Alt"] = true
diff --git a/StarTip.lua b/StarTip.lua
index 519b3bd..b1845f4 100644
--- a/StarTip.lua
+++ b/StarTip.lua
@@ -33,12 +33,13 @@ environment.L = L

 local BugGrabber = BugGrabber

-local function disableUT(name)
+local function disableUT(name, side)
 	local UT = StarTip:GetModule("UnitTooltip")
 	for k, v in pairs(UT.db.profile.lines) do
 		if(v.name == name) then
 			UT.db.profile.lines[k].enabled = false
 			UT:CreateLines()
+			StarTip:Print(format(L["StarTip disabled a tooltip line named %s due to an error in the line's %s segment."], v.name, side))
 		end
 	end
 end
@@ -50,10 +51,10 @@ do
 		for k, v in pairs(addon:GetErrors(BugGrabber:GetSessionId())) do
 			if type(v.message) == "string" then
 				v.message:gsub('t.*StarTip\.UnitTooltip:(.*):left:.*', function(name)
-					disableUT(name)
+					disableUT(name, "left")
 				end)
 				v.message:gsub('t.*StarTip\.UnitTooltip:(.*):right:.*', function(name)
-					disableUT(name)
+					disableUT(name, "right")
 				end)
 			end
 		end