MCPcopy Create free account
hub / github.com/ObEngine/ObEngine / lua_exception_handler

Function lua_exception_handler

src/Core/Engine/Engine.cpp:5–18  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3#include <Utils/StringUtils.hpp>
4
5int lua_exception_handler(lua_State* L,
6 sol::optional<const std::exception&> maybe_exception, sol::string_view description)
7{
8 if (maybe_exception)
9 {
10 const std::exception& ex = *maybe_exception;
11 obe::Debug::Log->error("<LuaError>[Exception] : {}", ex.what());
12 }
13 else
14 {
15 obe::Debug::Log->error("<LuaError>[Error] : {}", description);
16 }
17 return sol::stack::push(L, description);
18}
19
20namespace obe::Engine
21{

Callers

nothing calls this directly

Calls 3

pushFunction · 0.85
errorMethod · 0.45
whatMethod · 0.45

Tested by

no test coverage detected