diff --git a/Barotrauma/BarotraumaShared/SharedSource/LuaCs/Plugins/CsPackageManager.cs b/Barotrauma/BarotraumaShared/SharedSource/LuaCs/Plugins/CsPackageManager.cs index 8ba1f8921c..507ea8e9e1 100644 --- a/Barotrauma/BarotraumaShared/SharedSource/LuaCs/Plugins/CsPackageManager.cs +++ b/Barotrauma/BarotraumaShared/SharedSource/LuaCs/Plugins/CsPackageManager.cs @@ -830,8 +830,14 @@ private void TryRun(Action action, string messageMethodName, string messageTypeN } catch (Exception e) { + StackTrace st = new StackTrace(e); + String s = String.Join('\n', + st.GetFrames().SkipLast(1) + .Select(f => $"at {f.GetMethod().DeclaringType}.{f.GetMethod().Name}()") + ); + ModUtils.Logging.PrintError($"{nameof(CsPackageManager)}: Error while running {messageMethodName}() on plugin of type {messageTypeName}"); - ModUtils.Logging.PrintError($"{nameof(CsPackageManager)}: Details: {e.Message} | {e.InnerException}"); + ModUtils.Logging.PrintError($"{nameof(CsPackageManager)}: Details: {e.Message}\n{s}"); } }