From 29a39b4be1a15831be736ef26f17dbd5f3cbe9d6 Mon Sep 17 00:00:00 2001 From: goat <16760685+goaaats@users.noreply.github.com> Date: Tue, 25 Jan 2022 19:20:56 +0100 Subject: [PATCH] fix: log exceptions when drawing DataWindow data --- Dalamud/Interface/Internal/Windows/DataWindow.cs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Dalamud/Interface/Internal/Windows/DataWindow.cs b/Dalamud/Interface/Internal/Windows/DataWindow.cs index 741ba46f4..b5d9684bd 100644 --- a/Dalamud/Interface/Internal/Windows/DataWindow.cs +++ b/Dalamud/Interface/Internal/Windows/DataWindow.cs @@ -53,6 +53,7 @@ namespace Dalamud.Interface.Internal.Windows private readonly string[] dataKindNames = Enum.GetNames(typeof(DataKind)).Select(k => k.Replace("_", " ")).ToArray(); private bool wasReady; + private bool isExcept; private string serverOpString; private DataKind currentKind; @@ -345,9 +346,18 @@ namespace Dalamud.Interface.Internal.Windows { ImGui.TextUnformatted("Data not ready."); } + + this.isExcept = false; } catch (Exception ex) { + if (!this.isExcept) + { + Log.Error(ex, "Could not draw data"); + } + + this.isExcept = true; + ImGui.TextUnformatted(ex.ToString()); }