From 293352699504daa10cf4be7e1212a72ad53b18e8 Mon Sep 17 00:00:00 2001 From: David Cernat Date: Fri, 30 Nov 2018 22:01:02 +0200 Subject: [PATCH] [Server] Include errors related to Lua calls in server logs --- apps/openmw-mp/Script/Script.hpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/apps/openmw-mp/Script/Script.hpp b/apps/openmw-mp/Script/Script.hpp index 713f6550d..ffa98d712 100644 --- a/apps/openmw-mp/Script/Script.hpp +++ b/apps/openmw-mp/Script/Script.hpp @@ -90,7 +90,17 @@ public: (callback)(std::forward(args)...); #if defined (ENABLE_LUA) else if (script->script_type == SCRIPT_LUA) - script->lang->Call(data.name, data.callback.types, B, std::forward(args)...); + { + try + { + script->lang->Call(data.name, data.callback.types, B, std::forward(args)...); + } + catch (std::exception &e) + { + LOG_MESSAGE_SIMPLE(Log::LOG_ERROR, e.what()); + throw; + } + } #endif ++count; }