Stanzilla / WoWUIBugs

World of Warcraft UI Bug Tracker
153 stars 7 forks source link

Script errors frame fails to show if manually triggered #582

Closed Meorawr closed 1 week ago

Meorawr commented 3 weeks ago

The script errors frame in 11.0 can no longer be shown through calls to functions such as CallErrorHandler as this call to GetErrorCallstackHeight returns a nil value while initializing the frame.

Presumably, this function only ever returns a non-nil value in contexts where there are no pcall/xpcall stack frames to handle the error, or for errors raised inside of a securecall-invoked function.

Test case

Execute the following in the chat frame. In all live client flavors, this would open the script errors panel with the message set to "foo". In 11.0.0, opening the error panel itself errors in this context because of the aforementioned nil return value. As a result an entirely different message appears, and the original "foo" message is lost.

/run CallErrorHandler("foo")

In the context of an xpcall, this means that the following pattern silently swallows any errors from failing function calls. This is used in various places throughout the UI source to log error conditions without necessarily treating them as fatal.

/run xpcall(error, CallErrorHandler, "this should show")
Meorawr commented 1 week ago

Fixed in 11.0.0.55288.