Event LUA_WARNING payload 0 and NULL
I did register for the event LUA_WARNING in case it would catch some of the silent errors that I have been getting, and indeed I do receive these events. The problem is that the payload is 0 (null) every single time and I can't for the world understand what is going wrong. I have no problem getting the payload from any of the other events that I am handling.
Here is the function that is receiving and handling the events: Code:
local function AST_Event_LUAWarning(self, event, ...) Code:
local function AST_EventAlreadyRegistered(newEventName) |
Where is your frame:OnEvent() part?
|
Have you tried printing the event sent to AST_Event_LUAWarning just in case you have somehow managed to AST_RegisterEvent() another event with no payload to that function association?
From the /API documents: Code:
ScriptWarnings->Events |
Wow! I seriously didn't expect to get answers that fast! Thank you!
Regarding printing the name of the event, I just printed the value that is passed in the event parameter. I do indeed get the correct event name, LUA_WARNING. I also tried to do a: Code:
print(...) The fact I do get a number and a string (nil - abscence of a string rather) like I am expecting makes me think Blizzard is hiding the information on purpose, but that does sound weird to me. Everything works perfectly for any other event, so I don't understand what is going on EDIT: I just noticed in your comment that it does say that neither of the values is nilable... That makes this even weirder. Here is the frame:OnEvent() part (sorry I didn't think it was important since the correct function does get called: Code:
local function AST_CreateWindowFrame() |
Try:
Code:
local function AST_Event_LUAWarning(self, event, ...) Code:
local function AST_Event_LUAWarning(self, event, ...) |
Thank you for pointing me in the right direction!
I think you are right, although the function HandleLuaWarning(...) did not do anything visible at all. It did not stop execution of the script either, so it is definitely a valid function. I will leave in your modified code for now as it seems that you are right that the code 0 is a script error. Now I need to locate where I put in those mistakes... I think I put them in on purpose but I don't remember where, lol. EDIT: A bit of research reveals the HandleLuaWarning function: Code:
function HandleLuaWarning(warnType, warningMessage) Either way, a warning message of nil is not much of help anyway. EDIT 2: Also, I found that the reason I never get any error messages no matter why, apart from this problem, is because WoW does not display script errors per default. It can be turned on by the following, but I assume this is not new to anyone here: Code:
/console scriptErrors 1 I have a theory that script errors are treated like they are (0 (null)) because you can enable them like above to have the game show you the error message anyway. After all the name is LUA_WARNINGS, not -ERRORS. My final version, for completeness: Code:
local function AST_Event_LUAWarning(self, event, ...) |
All times are GMT -6. The time now is 09:08 PM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI