| 3 | #include <Utils/StringUtils.hpp> |
| 4 | |
| 5 | int 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 | |
| 20 | namespace obe::Engine |
| 21 | { |