MCPcopy Create free account
hub / github.com/AutoHotkey/AutoHotkey / WhatThrew

Method WhatThrew

source/script.cpp:12568–12579  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

12566
12567#ifdef CONFIG_DEBUGGER
12568LPCTSTR Debugger::WhatThrew()
12569{
12570 // We want 'What' to indicate the function/sub/operation that *threw* the exception.
12571 // For BIFs, throwing is always explicit. For a UDF, 'What' should only name it if
12572 // it explicitly constructed the Exception object. This provides an easy way for
12573 // OnError and Catch to categorise errors. No information is lost because File/Line
12574 // can already be used locate the function/sub that was running.
12575 // So only return a name when a BIF is raising an error:
12576 if (mStack.mTop < mStack.mBottom || mStack.mTop->type != DbgStack::SE_BIF)
12577 return _T("");
12578 return mStack.mTop->func->mName;
12579}
12580#endif
12581
12582

Callers 2

ParamErrorMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected