Thread: LUA Error
View Single Post
04-18-10, 09:28 PM   #5
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,917
Seeing as this is the latest thread on this subject I thought I would put it here.

I just rigged up a mini addon that checks the variables prior to the reported errors in each of the start up events... of course my testing so far has come up with no errors .. whatsoever *sigh*... at present I have commented out the ReloadUI commands as I want to see if I have managed to trap the error tests properly and thus reports the errors prior to the error report itself so that an auto reloadui would mean people would not need to do it of course hopefully 1 or 2 reloads would be all thats needed .. rofl .. I'll have to test that out next time I get repeatable errors.

It validates the following values which seem to be fundamental to the errors reported :

Existence of nUI_TopBars table and its Anchors table.
Existence of dimensions to the ChatFrames.
Existence of nUI_Dashboard table and its Anchors table.

The moment it comes across an unexpected value it reports it with a date/time based table and documents certain values in relation to it which will hopefully help identify when it first kicks up a fuss.

It is currently checking the following Events which are supposed to be part of the loading process. However, data prior to the saved variables loading process may be overwritten, seeing as we are not sure at which point that is it is hard to say.

ADDON_LOADED
SPELLS_CHANGED
PLAYER_ENTERING_WORLD
PLAYER_LOGIN
PLAYER_ALIVE
VARIABLES_LOADED

I've also included a latency check in case that becomes a common factor in error occurences..

It generates 13kb of WTF data each start up test run so you may want to delete it every so often Although I called it ErrorFix it isn't really a fix rofl but anyone that wishes to use it for a while perhaps a comparison of the results will shed some common light on the subject. If it seems to identify the errors properly then uncommented the ReloadUI lines will be enough for it to trigger the reload automatically when those errors occur.



Here's an example of the results from my own test runs:
Code:
nUI_ErrorFix_Data = {
	["At 04:08:20 on 19, April, 2010 "] = {
		["ADDON_LOADED"] = {
			["Tests"] = {
				["1"] = {
					["nUI_TopBars"] = {
						["Exists"] = true,
						["nUI_TopBars.Anchor"] = {
							["Result"] = "OK",
							["Error"] = false,
							["Exists"] = true,
						},
					},
					["File"] = "nUI_MicroMenu.lua",
				},
				["3"] = {
					["nUI_Dashboard"] = {
						["Exists"] = true,
						["nUI_Dashboard.Anchor"] = {
							["Result"] = "OK",
							["Error"] = false,
							["Exists"] = true,
						},
					},
					["File"] = "nUI_XPBar.lua",
				},
				["2"] = {
					["ChatFrame5"] = {
						["Exists"] = true,
						["Result"] = "OK",
						["isDocked"] = false,
						["DimensionsValid"] = true,
						["Error"] = false,
					},
					["ChatFrame4"] = {
						["Exists"] = true,
						["Result"] = "OK",
						["isDocked"] = false,
						["DimensionsValid"] = true,
						["Error"] = false,
					},
					["ChatFrame7"] = {
						["Exists"] = true,
						["Result"] = "OK",
						["isDocked"] = false,
						["DimensionsValid"] = true,
						["Error"] = false,
					},
					["ChatFrame3"] = {
						["Exists"] = true,
						["Result"] = "OK",
						["isDocked"] = false,
						["DimensionsValid"] = true,
						["Error"] = false,
					},
					["ChatFrame2"] = {
						["Exists"] = true,
						["Result"] = "OK",
						["isDocked"] = false,
						["DimensionsValid"] = true,
						["Error"] = false,
					},
					["File"] = "nUI_ChatFrame.lua",
					["ChatFrame6"] = {
						["Exists"] = true,
						["Result"] = "OK",
						["isDocked"] = 1,
						["DimensionsValid"] = true,
						["Error"] = false,
					},
					["ChatFrame1"] = {
						["Exists"] = true,
						["Result"] = "OK",
						["isDocked"] = 1,
						["DimensionsValid"] = true,
						["Error"] = false,
					},
				},
			},
			["Arg1"] = "Blizzard_TradeSkillUI",
			["Latency"] = {
				["DownloadUsage"] = 2.333034515380859,
				["Lag"] = 454,
				["UploadUsage"] = 0.01163386553525925,
			},
		},
	},
	["At 04:08:21 on 19, April, 2010 "] = {
		["PLAYER_ALIVE"] = {
			["Tests"] = {
				["1"] = {
					["nUI_TopBars"] = {
						["Exists"] = true,
						["nUI_TopBars.Anchor"] = {
							["Result"] = "OK",
							["Error"] = false,
							["Exists"] = true,
						},
					},
					["File"] = "nUI_MicroMenu.lua",
				},
				["3"] = {
					["nUI_Dashboard"] = {
						["Exists"] = true,
						["nUI_Dashboard.Anchor"] = {
							["Result"] = "OK",
							["Error"] = false,
							["Exists"] = true,
						},
					},
					["File"] = "nUI_XPBar.lua",
				},
				["2"] = {
					["ChatFrame5"] = {
						["Exists"] = true,
						["Result"] = "OK",
						["isDocked"] = false,
						["DimensionsValid"] = true,
						["Error"] = false,
					},
					["ChatFrame4"] = {
						["Exists"] = true,
						["Result"] = "OK",
						["isDocked"] = false,
						["DimensionsValid"] = true,
						["Error"] = false,
					},
					["ChatFrame7"] = {
						["Exists"] = true,
						["Result"] = "OK",
						["isDocked"] = false,
						["DimensionsValid"] = true,
						["Error"] = false,
					},
					["ChatFrame3"] = {
						["Exists"] = true,
						["Result"] = "OK",
						["isDocked"] = false,
						["DimensionsValid"] = true,
						["Error"] = false,
					},
					["ChatFrame2"] = {
						["Exists"] = true,
						["Result"] = "OK",
						["isDocked"] = false,
						["DimensionsValid"] = true,
						["Error"] = false,
					},
					["File"] = "nUI_ChatFrame.lua",
					["ChatFrame6"] = {
						["Exists"] = true,
						["Result"] = "OK",
						["isDocked"] = 1,
						["DimensionsValid"] = true,
						["Error"] = false,
					},
					["ChatFrame1"] = {
						["Exists"] = true,
						["Result"] = "OK",
						["isDocked"] = 1,
						["DimensionsValid"] = true,
						["Error"] = false,
					},
				},
			},
			["Latency"] = {
				["DownloadUsage"] = 2.332579135894775,
				["Lag"] = 454,
				["UploadUsage"] = 0.01177166309207678,
			},
		},
	},
	["At 04:08:18 on 19, April, 2010 "] = {
		["ADDON_LOADED"] = {
			["Tests"] = {
				["1"] = {
					["nUI_TopBars"] = {
						["Exists"] = true,
						["nUI_TopBars.Anchor"] = {
							["Result"] = "OK",
							["Error"] = false,
							["Exists"] = true,
						},
					},
					["File"] = "nUI_MicroMenu.lua",
				},
				["3"] = {
					["nUI_Dashboard"] = {
						["Exists"] = true,
						["nUI_Dashboard.Anchor"] = {
							["Result"] = "OK",
							["Error"] = false,
							["Exists"] = true,
						},
					},
					["File"] = "nUI_XPBar.lua",
				},
				["2"] = {
					["ChatFrame5"] = {
						["Exists"] = true,
						["Result"] = "OK",
						["isDocked"] = false,
						["DimensionsValid"] = true,
						["Error"] = false,
					},
					["ChatFrame4"] = {
						["Exists"] = true,
						["Result"] = "OK",
						["isDocked"] = false,
						["DimensionsValid"] = true,
						["Error"] = false,
					},
					["ChatFrame7"] = {
						["Exists"] = true,
						["Result"] = "OK",
						["isDocked"] = false,
						["DimensionsValid"] = true,
						["Error"] = false,
					},
					["ChatFrame3"] = {
						["Exists"] = true,
						["Result"] = "OK",
						["isDocked"] = false,
						["DimensionsValid"] = true,
						["Error"] = false,
					},
					["ChatFrame2"] = {
						["Exists"] = true,
						["Result"] = "Reloading...",
						["isDocked"] = false,
						["DimensionsValid"] = false,
						["Error"] = true,
					},
					["File"] = "nUI_ChatFrame.lua",
					["ChatFrame6"] = {
						["Exists"] = true,
						["Result"] = "OK",
						["isDocked"] = 1,
						["DimensionsValid"] = true,
						["Error"] = false,
					},
					["ChatFrame1"] = {
						["Exists"] = true,
						["Result"] = "OK",
						["isDocked"] = 1,
						["DimensionsValid"] = true,
						["Error"] = false,
					},
				},
			},
			["Arg1"] = "Blizzard_BattlefieldMinimap",
			["Latency"] = {
				["DownloadUsage"] = 2.335074901580811,
				["Lag"] = 454,
				["UploadUsage"] = 0.01164403930306435,
			},
		},
	},
	["At 04:08:13 on 19, April, 2010 "] = {
		["ADDON_LOADED"] = {
			["Tests"] = {
				["1"] = {
					["nUI_TopBars"] = {
						["Exists"] = true,
						["nUI_TopBars.Anchor"] = {
							["Result"] = "OK",
							["Error"] = false,
							["Exists"] = true,
						},
					},
					["File"] = "nUI_MicroMenu.lua",
				},
				["3"] = {
					["nUI_Dashboard"] = {
						["Exists"] = true,
						["nUI_Dashboard.Anchor"] = {
							["Result"] = "OK",
							["Error"] = false,
							["Exists"] = true,
						},
					},
					["File"] = "nUI_XPBar.lua",
				},
				["2"] = {
					["ChatFrame5"] = {
						["Exists"] = true,
						["Result"] = "OK",
						["isDocked"] = false,
						["DimensionsValid"] = true,
						["Error"] = false,
					},
					["ChatFrame4"] = {
						["Exists"] = true,
						["Result"] = "OK",
						["isDocked"] = false,
						["DimensionsValid"] = true,
						["Error"] = false,
					},
					["ChatFrame7"] = {
						["Exists"] = true,
						["Result"] = "OK",
						["isDocked"] = false,
						["DimensionsValid"] = true,
						["Error"] = false,
					},
					["ChatFrame3"] = {
						["Exists"] = true,
						["Result"] = "OK",
						["isDocked"] = false,
						["DimensionsValid"] = true,
						["Error"] = false,
					},
					["ChatFrame2"] = {
						["Exists"] = true,
						["Result"] = "OK",
						["isDocked"] = 1,
						["DimensionsValid"] = true,
						["Error"] = false,
					},
					["File"] = "nUI_ChatFrame.lua",
					["ChatFrame6"] = {
						["Exists"] = true,
						["Result"] = "OK",
						["isDocked"] = false,
						["DimensionsValid"] = true,
						["Error"] = false,
					},
					["ChatFrame1"] = {
						["Exists"] = true,
						["Result"] = "OK",
						["isDocked"] = 1,
						["DimensionsValid"] = true,
						["Error"] = false,
					},
				},
			},
			["Arg1"] = "SkadaThreat",
			["Latency"] = {
				["DownloadUsage"] = 2.304597854614258,
				["Lag"] = 454,
				["UploadUsage"] = 0.01157387252897024,
			},
		},
	},
	["At 04:08:14 on 19, April, 2010 "] = {
		["ADDON_LOADED"] = {
			["Tests"] = {
				["1"] = {
					["nUI_TopBars"] = {
						["Exists"] = true,
						["nUI_TopBars.Anchor"] = {
							["Result"] = "OK",
							["Error"] = false,
							["Exists"] = true,
						},
					},
					["File"] = "nUI_MicroMenu.lua",
				},
				["3"] = {
					["nUI_Dashboard"] = {
						["Exists"] = true,
						["nUI_Dashboard.Anchor"] = {
							["Result"] = "OK",
							["Error"] = false,
							["Exists"] = true,
						},
					},
					["File"] = "nUI_XPBar.lua",
				},
				["2"] = {
					["ChatFrame5"] = {
						["Exists"] = true,
						["Result"] = "OK",
						["isDocked"] = false,
						["DimensionsValid"] = true,
						["Error"] = false,
					},
					["ChatFrame4"] = {
						["Exists"] = true,
						["Result"] = "OK",
						["isDocked"] = false,
						["DimensionsValid"] = true,
						["Error"] = false,
					},
					["ChatFrame7"] = {
						["Exists"] = true,
						["Result"] = "OK",
						["isDocked"] = false,
						["DimensionsValid"] = true,
						["Error"] = false,
					},
					["ChatFrame3"] = {
						["Exists"] = true,
						["Result"] = "OK",
						["isDocked"] = false,
						["DimensionsValid"] = true,
						["Error"] = false,
					},
					["ChatFrame2"] = {
						["Exists"] = true,
						["Result"] = "OK",
						["isDocked"] = 1,
						["DimensionsValid"] = true,
						["Error"] = false,
					},
					["File"] = "nUI_ChatFrame.lua",
					["ChatFrame6"] = {
						["Exists"] = true,
						["Result"] = "OK",
						["isDocked"] = false,
						["DimensionsValid"] = true,
						["Error"] = false,
					},
					["ChatFrame1"] = {
						["Exists"] = true,
						["Result"] = "OK",
						["isDocked"] = 1,
						["DimensionsValid"] = true,
						["Error"] = false,
					},
				},
			},
			["Arg1"] = "Xrystal_WatchFrame",
			["Latency"] = {
				["DownloadUsage"] = 2.304401874542236,
				["Lag"] = 454,
				["UploadUsage"] = 0.01157288812100887,
			},
		},
	},
	["At 04:08:17 on 19, April, 2010 "] = {
		["VARIABLES_LOADED"] = {
			["Tests"] = {
				["1"] = {
					["nUI_TopBars"] = {
						["Exists"] = true,
						["nUI_TopBars.Anchor"] = {
							["Result"] = "OK",
							["Error"] = false,
							["Exists"] = true,
						},
					},
					["File"] = "nUI_MicroMenu.lua",
				},
				["3"] = {
					["nUI_Dashboard"] = {
						["Exists"] = true,
						["nUI_Dashboard.Anchor"] = {
							["Result"] = "OK",
							["Error"] = false,
							["Exists"] = true,
						},
					},
					["File"] = "nUI_XPBar.lua",
				},
				["2"] = {
					["ChatFrame5"] = {
						["Exists"] = true,
						["Result"] = "OK",
						["isDocked"] = false,
						["DimensionsValid"] = true,
						["Error"] = false,
					},
					["ChatFrame4"] = {
						["Exists"] = true,
						["Result"] = "OK",
						["isDocked"] = false,
						["DimensionsValid"] = true,
						["Error"] = false,
					},
					["ChatFrame7"] = {
						["Exists"] = true,
						["Result"] = "OK",
						["isDocked"] = false,
						["DimensionsValid"] = true,
						["Error"] = false,
					},
					["ChatFrame3"] = {
						["Exists"] = true,
						["Result"] = "OK",
						["isDocked"] = false,
						["DimensionsValid"] = true,
						["Error"] = false,
					},
					["ChatFrame2"] = {
						["Exists"] = true,
						["Result"] = "OK",
						["isDocked"] = 1,
						["DimensionsValid"] = true,
						["Error"] = false,
					},
					["File"] = "nUI_ChatFrame.lua",
					["ChatFrame6"] = {
						["Exists"] = true,
						["Result"] = "OK",
						["isDocked"] = false,
						["DimensionsValid"] = true,
						["Error"] = false,
					},
					["ChatFrame1"] = {
						["Exists"] = true,
						["Result"] = "OK",
						["isDocked"] = 1,
						["DimensionsValid"] = true,
						["Error"] = false,
					},
				},
			},
			["Latency"] = {
				["DownloadUsage"] = 2.303675174713135,
				["Lag"] = 454,
				["UploadUsage"] = 0.01156135182827711,
			},
		},
	},
}
Attached Files
File Type: zip nUI_ErrorFix.zip (1.5 KB, 663 views)
__________________