From 557052bbc7815d464865e93b398d73273b908b1e Mon Sep 17 00:00:00 2001 From: Elias Fierke Date: Sat, 16 May 2026 18:19:19 +0200 Subject: [PATCH] [chore:] logging for EditorWindow.axaml.cs --- Wiki/EditorWindow.axaml.cs | 31 ++++++++++++++++++------------- 1 file changed, 18 insertions(+), 13 deletions(-) diff --git a/Wiki/EditorWindow.axaml.cs b/Wiki/EditorWindow.axaml.cs index 5353f97..4ff8fc4 100644 --- a/Wiki/EditorWindow.axaml.cs +++ b/Wiki/EditorWindow.axaml.cs @@ -11,19 +11,23 @@ public partial class EditorWindow : Window public EditorWindow(string filename = "") { - InitializeComponent(); - this.filename = filename; - if (!string.IsNullOrWhiteSpace(filename) && File.Exists(filename)) + try { - var content = TbContent; - if (content != null) content.Text = File.ReadAllText(this.filename); - Title = "Wiki Editor - " + filename; - } - else if (!string.IsNullOrWhiteSpace(filename)) - { - MessageBox.Show(null, "Die Datei existiert nicht", "Fehler"); - Close(); - } + InitializeComponent(); + this.filename = filename; + if (!string.IsNullOrWhiteSpace(filename) && File.Exists(filename)) + { + var content = TbContent; + if (content != null) content.Text = File.ReadAllText(this.filename); + Title = "Wiki Editor - " + filename; + } + else if (!string.IsNullOrWhiteSpace(filename)) + { + MessageBox.Show(null, "Die Datei existiert nicht", "Fehler"); + Close(); + } + } catch (Exception ex) { Logger.Log($"Error while : {ex.Message}",Logger.LogType.Error);} + } private void BtnSave_OnClick(object? sender, RoutedEventArgs e) @@ -38,6 +42,7 @@ public partial class EditorWindow : Window MessageBox.Show(null, "Es ist ein Fehler aufgetreten. Bitte senden Sie ihn über git.mypapercloud.de/fierke/logofclient ein:\n" + ex.StackTrace, "Fehler"); + Logger.Log($"Error while : {ex.Message}",Logger.LogType.Error); } } @@ -55,7 +60,7 @@ public partial class EditorWindow : Window try { File.Delete(filename); - } catch {} + } catch (Exception ex) { Logger.Log($"Error while : {ex.Message}",Logger.LogType.Error);} MainWindow._instance.PopulateNavTree(); Close();