From 9ab540b614f49bf7b2d0186bf8c17cd1525e1d40 Mon Sep 17 00:00:00 2001 From: Peter van Dijk Date: Tue, 17 Apr 2018 20:37:13 +0200 Subject: [PATCH] when panicing, report why, and don't exit zero --- include/LuaContext.hpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/include/LuaContext.hpp b/include/LuaContext.hpp index 1e9bcbb..18fe3e2 100644 --- a/include/LuaContext.hpp +++ b/include/LuaContext.hpp @@ -32,12 +32,14 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include #include #include +#include #include #include #include #include #include #include +#include #include #include #include @@ -97,9 +99,10 @@ class LuaContext { // setting the panic function lua_atpanic(mState, [](lua_State* state) -> int { const std::string str = lua_tostring(state, -1); + std::cerr<<"lua panic: "<