cleanup and add comments to traceback feature

This commit is contained in:
Lion Kortlepel 2024-07-14 01:50:31 +02:00
parent 6f4c3f0ceb
commit 9db3619cd8
No known key found for this signature in database
GPG Key ID: 4322FF2B4C71259B

View File

@ -1161,10 +1161,9 @@ void TLuaEngine::StateThreadData::operator()() {
if (Error.has_value()) {
ErrorString = Error.value();
}
auto DebugTracebackFn = sol::state_view(L).globals()
.get<sol::table>("debug")
.get<sol::protected_function>("traceback");
std::string Traceback = DebugTracebackFn(ErrorString, 2); // refusing to elaborate. questions? rtfm.
auto DebugTracebackFn = sol::state_view(L).globals().get<sol::table>("debug").get<sol::protected_function>("traceback");
// 2 = start collecting the trace one above the current function (1=current function)
std::string Traceback = DebugTracebackFn(ErrorString, 2);
return sol::stack::push(L, Traceback);
};
sol::protected_function Fn(RawFn, StateView["INTERNAL_ERROR_HANDLER"]);