From 22f74a31a2ecc3ca0bda0e864fb5470e81a3c497 Mon Sep 17 00:00:00 2001 From: ThePhD Date: Thu, 3 Mar 2016 03:16:59 -0500 Subject: [PATCH] Catch EVERYTHING, even the shit we don't know about. --- sol/protected_function.hpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sol/protected_function.hpp b/sol/protected_function.hpp index b9eda3a2..f7538199 100644 --- a/sol/protected_function.hpp +++ b/sol/protected_function.hpp @@ -123,7 +123,9 @@ private: return protected_function_result(lua_state(), firstreturn, 0, 1, call_status::runtime); } catch (...) { - throw; + onexcept("caught (...) unknown error during protected_function call"); + firstreturn = lua_gettop(lua_state()); + return protected_function_result(lua_state(), firstreturn, 0, 1, call_status::runtime); } #endif // No Exceptions return protected_function_result(lua_state(), firstreturn + ( handlerpushed ? 0 : 1 ), returncount, returncount, code);