--FrameXML_Debug(1);
_ERROR_COUNT = 0; _ERROR_LIMIT = 1000;

function _ERRORMESSAGE(message) debuginfo() -- Debugging information for internal use.

LoadAddOn("Blizzard_DebugTools"); local loaded = IsAddOnLoaded("Blizzard_DebugTools");

if ( GetCVarBool("scriptErrors") ) then if ( not loaded or DEBUG_DEBUGTOOLS ) then BasicScriptErrorsText:SetText(message); BasicScriptErrors:Show(); if ( DEBUG_DEBUGTOOLS ) then ScriptErrorsFrame_OnError(message); end else ScriptErrorsFrame_OnError(message); end elseif ( loaded ) then local HIDE_ERROR_FRAME = true; ScriptErrorsFrame_OnError(message, HIDE_ERROR_FRAME); end

-- Show a warning if there are too many errors _ERROR_COUNT = _ERROR_COUNT + 1; if ( _ERROR_COUNT == _ERROR_LIMIT ) then StaticPopup_Show("TOO_MANY_LUA_ERRORS"); end

return message; end

seterrorhandler(_ERRORMESSAGE);
function message(text) if ( not BasicScriptErrors:IsShown() ) then BasicScriptErrorsText:SetText(text); BasicScriptErrors:Show(); end end
function TEXT(text) return text; end
self:GetParent():Hide();