[chore:] basic logging

This commit is contained in:
2026-05-16 14:41:16 +02:00
parent 6f03a26c29
commit 6dfab5e73a
+198 -142
View File
@@ -24,6 +24,9 @@ public partial class MainWindow : Window
public MainWindow() public MainWindow()
{ {
Logger.Log("Welcome to logofclient");
Logger.Log($"Session on {DateTime.Now:G}");
Logger.Log("Initializing...");
InitializeComponent(); InitializeComponent();
//Hide(); //Hide();
@@ -32,6 +35,7 @@ public partial class MainWindow : Window
_instance = this; _instance = this;
WindowState = WindowState.Maximized; WindowState = WindowState.Maximized;
Logger.Log("Loading settings...");
Global.Load(); Global.Load();
Settings.Load(); Settings.Load();
LoadPdfExportOptions(); LoadPdfExportOptions();
@@ -40,6 +44,7 @@ public partial class MainWindow : Window
RefreshCountryView(); RefreshCountryView();
// Initialize wiki integration // Initialize wiki integration
Logger.Log("Buliding wiki...");
_wikiService = new WikiService(); _wikiService = new WikiService();
try try
{ {
@@ -54,8 +59,9 @@ public partial class MainWindow : Window
if (!string.IsNullOrWhiteSpace(Global._instance.wiki_storage_path)) if (!string.IsNullOrWhiteSpace(Global._instance.wiki_storage_path))
TbWikiPath.Text = Global._instance.wiki_storage_path; TbWikiPath.Text = Global._instance.wiki_storage_path;
} }
catch catch (Exception ex)
{ {
Logger.Log($"Error while setting paths: {ex.Message}", Logger.LogType.Error);
} }
try try
@@ -64,12 +70,14 @@ public partial class MainWindow : Window
BtnFontPath.Click += BtnFontPath_Click; BtnFontPath.Click += BtnFontPath_Click;
BtnConfigPath.Click += BtnConfigPath_Click; BtnConfigPath.Click += BtnConfigPath_Click;
} }
catch catch (Exception ex)
{ {
Logger.Log($"Error while adding click functions?: {ex.Message}", Logger.LogType.Error);
} }
} }
catch catch (Exception ex)
{ {
Logger.Log($"Error while doing wiki stuff: {ex.Message}", Logger.LogType.Error);
} }
//Thread.Sleep(3000); //Thread.Sleep(3000);
@@ -121,23 +129,6 @@ public partial class MainWindow : Window
//await MessageBox.Show(_instance, $"{result.Count} Einträge fehlerhaft.", "Fertig"); //await MessageBox.Show(_instance, $"{result.Count} Einträge fehlerhaft.", "Fertig");
} }
// private async void StartAddressRepair(Uri path)
// {
// var addresses = DataImport.ImportKasAddressList(path); // Ihr Code hier
// var progressWindow = new ProgressWindow();
//
// progressWindow.Show(_instance);
//
// var processor = new AddressRepair(progressWindow);
// //var result = await processor.Perform(addresses.Item2, errors);
//
//
// progressWindow.Close();
//
//
// //new ResultWindow(result, addresses.Item2).Show();
// //await MessageBox.Show(_instance, $"{result.Count} Einträge fehlerhaft.", "Fertig");
// }
private void MnuExit_OnClick(object? sender, RoutedEventArgs e) private void MnuExit_OnClick(object? sender, RoutedEventArgs e)
{ {
@@ -156,7 +147,7 @@ public partial class MainWindow : Window
} }
catch (Exception ex) catch (Exception ex)
{ {
Console.WriteLine($"Fehler beim Öffnen des Links: {ex.Message}"); Logger.Log($"Error while starting process: {ex.Message}", Logger.LogType.Error);
} }
} }
@@ -172,7 +163,7 @@ public partial class MainWindow : Window
} }
catch (Exception ex) catch (Exception ex)
{ {
Console.WriteLine($"Fehler beim Öffnen des Links: {ex.Message}"); Logger.Log($"Error while starting process: {ex.Message}", Logger.LogType.Error);
} }
} }
@@ -188,7 +179,7 @@ public partial class MainWindow : Window
} }
catch (Exception ex) catch (Exception ex)
{ {
Console.WriteLine($"Fehler beim Öffnen des Links: {ex.Message}"); Logger.Log($"Error while starting process: {ex.Message}", Logger.LogType.Error);
} }
} }
@@ -232,9 +223,9 @@ public partial class MainWindow : Window
var rendered = MarkdownRenderer.Render(text ?? string.Empty); var rendered = MarkdownRenderer.Render(text ?? string.Empty);
PreviewPanel.Children.Add(rendered); PreviewPanel.Children.Add(rendered);
} }
catch catch (Exception ex)
{ {
// fallback: plain text Logger.Log($"Error while rendering markdown: {ex.Message}", Logger.LogType.Error);
PreviewPanel.Children.Clear(); PreviewPanel.Children.Clear();
PreviewPanel.Children.Add(new TextBlock { Text = text ?? string.Empty }); PreviewPanel.Children.Add(new TextBlock { Text = text ?? string.Empty });
} }
@@ -250,18 +241,24 @@ public partial class MainWindow : Window
public void PopulateNavTree(string? expandToPath = null, string? selectPath = null) public void PopulateNavTree(string? expandToPath = null, string? selectPath = null)
{ {
var roots = _wikiService.GetRootItems(); try
var nodes = new List<TreeViewItem>(); {
foreach (var r in roots) nodes.Add(BuildNode(r)); var roots = _wikiService.GetRootItems();
NavTree.ItemsSource = nodes; var nodes = new List<TreeViewItem>();
foreach (var r in roots) nodes.Add(BuildNode(r));
NavTree.ItemsSource = nodes;
if (!string.IsNullOrWhiteSpace(expandToPath)) if (!string.IsNullOrWhiteSpace(expandToPath))
ExpandAndFindNode(nodes, expandToPath, out _); ExpandAndFindNode(nodes, expandToPath, out _);
if (!string.IsNullOrWhiteSpace(selectPath) && if (!string.IsNullOrWhiteSpace(selectPath) &&
ExpandAndFindNode(nodes, selectPath, out var selectedNode) && ExpandAndFindNode(nodes, selectPath, out var selectedNode) &&
selectedNode != null) selectedNode != null)
NavTree.SelectedItem = selectedNode; NavTree.SelectedItem = selectedNode;
}catch (Exception ex)
{
Logger.Log($"Error while populating nav tree: {ex.Message}", Logger.LogType.Error);
}
} }
private TreeViewItem BuildNode(WikiItem item) private TreeViewItem BuildNode(WikiItem item)
@@ -276,16 +273,23 @@ public partial class MainWindow : Window
private string GetSelectedWikiTargetDirectory() private string GetSelectedWikiTargetDirectory()
{ {
var wikiRoot = Global._instance.wiki_storage_path; try
if (NavTree.SelectedItem is TreeViewItem treeItem && treeItem.Tag is WikiItem selectedItem)
{ {
if (selectedItem.IsFolder) return selectedItem.Path; var wikiRoot = Global._instance.wiki_storage_path;
if (NavTree.SelectedItem is TreeViewItem treeItem && treeItem.Tag is WikiItem selectedItem)
{
if (selectedItem.IsFolder) return selectedItem.Path;
var parentDir = Path.GetDirectoryName(selectedItem.Path); var parentDir = Path.GetDirectoryName(selectedItem.Path);
if (!string.IsNullOrWhiteSpace(parentDir)) return parentDir; if (!string.IsNullOrWhiteSpace(parentDir)) return parentDir;
}
return wikiRoot;
}catch (Exception ex)
{
Logger.Log($"Error while getting selected wiki target directory: {ex.Message}", Logger.LogType.Error);
} }
return wikiRoot; return null;
} }
private static bool PathsEqual(string left, string right) private static bool PathsEqual(string left, string right)
@@ -344,8 +348,9 @@ public partial class MainWindow : Window
UseShellExecute = true UseShellExecute = true
}); });
} }
catch catch (Exception ex)
{ {
Logger.Log($"Error while starting process: {ex.Message}", Logger.LogType.Error);
} }
} }
@@ -443,8 +448,9 @@ public partial class MainWindow : Window
{ {
LstSettingsCustomers.SelectedIndex = LstSettingsCustomers.Items.Count - 1; LstSettingsCustomers.SelectedIndex = LstSettingsCustomers.Items.Count - 1;
} }
catch catch (Exception ex)
{ {
Logger.Log($"Error while setting selected item: {ex.Message}", Logger.LogType.Error);
} }
} }
@@ -515,17 +521,25 @@ public partial class MainWindow : Window
{ {
LstSettingsCustomers.SelectedIndex = index; LstSettingsCustomers.SelectedIndex = index;
} }
catch catch (Exception ex)
{ {
Logger.Log($"Error while setting selected index: {ex.Message}", Logger.LogType.Error);
} }
} }
private void TbSettingsCustomerDescription_OnTextChanged(object? sender, TextChangedEventArgs e) private void TbSettingsCustomerDescription_OnTextChanged(object? sender, TextChangedEventArgs e)
{ {
if (LstSettingsCustomers.SelectedIndex == null || LstSettingsCustomers.SelectedIndex == -1) return; try
foreach (var customer in Settings._instance.customers.customers) {
if (customer.ID == Settings._instance.customers.current.ID) if (LstSettingsCustomers.SelectedIndex == null || LstSettingsCustomers.SelectedIndex == -1) return;
customer.description = TbSettingsCustomerDescription.Text; foreach (var customer in Settings._instance.customers.customers)
if (customer.ID == Settings._instance.customers.current.ID)
customer.description = TbSettingsCustomerDescription.Text;
} catch (Exception ex)
{
Logger.Log($"Error while changing customer description: {ex.Message}", Logger.LogType.Error);
}
//Settings.Save(); //Settings.Save();
} }
@@ -545,63 +559,72 @@ public partial class MainWindow : Window
private async void BtnCustomerAddressSetImport_OnClick(object? sender, RoutedEventArgs e) private async void BtnCustomerAddressSetImport_OnClick(object? sender, RoutedEventArgs e)
{ {
MakeCalcManVisible(); try
var opts = new FilePickerOpenOptions(); {
opts.Title = "Address-Set importieren..."; MakeCalcManVisible();
opts.AllowMultiple = false; var opts = new FilePickerOpenOptions();
opts.Title = "Address-Set importieren...";
opts.AllowMultiple = false;
var type = new FilePickerFileType("CSV-Dateien (*.csv)"); var type = new FilePickerFileType("CSV-Dateien (*.csv)");
type.Patterns = new[] { "*.csv" }; type.Patterns = new[] { "*.csv" };
opts.FileTypeFilter = new[] { type }; opts.FileTypeFilter = new[] { type };
var paths = await StorageProvider.OpenFilePickerAsync(opts); var paths = await StorageProvider.OpenFilePickerAsync(opts);
if (paths?.Count <= 0) return; if (paths?.Count <= 0) return;
if (LstCustomers.SelectedIndex < 0) return; if (LstCustomers.SelectedIndex < 0) return;
var selected_path = paths[0].Path; var selected_path = paths[0].Path;
foreach (var customer in Settings._instance.customers.customers) foreach (var customer in Settings._instance.customers.customers)
if (customer == ((Customer)LstCustomers.SelectedItems[0])) if (customer == ((Customer)LstCustomers.SelectedItems[0]))
{ {
if (customer.patch == null) if (customer.patch == null)
{ {
var got = await DataImport.ImportKasAddressList(selected_path, null, customer.separator); var got = await DataImport.ImportKasAddressList(selected_path, null, customer.separator);
if (!got.Item1) if (!got.Item1)
{ {
Console.WriteLine("Error while importing. Please try another file."); Console.WriteLine("Error while importing. Please try another file.");
} }
else else
{ {
got.Item2.SetOwner(customer.ID); got.Item2.SetOwner(customer.ID);
Settings._instance.addressSets.addresses.Add(got.Item2); Settings._instance.addressSets.addresses.Add(got.Item2);
} }
//var customer_id = int.Parse(LstCustomers.SelectedItem.ToString().Split(" - ")[0]); //var customer_id = int.Parse(LstCustomers.SelectedItem.ToString().Split(" - ")[0]);
RefreshAddressSetListItems(customer.ID); RefreshAddressSetListItems(customer.ID);
} }
else else
{ {
var got = await DataImport.ImportKasAddressList(selected_path, customer.patch, customer.separator); var got = await DataImport.ImportKasAddressList(selected_path, customer.patch, customer.separator);
if (!got.Item1) if (!got.Item1)
{ {
Console.WriteLine("Error while importing. Please try another file."); Console.WriteLine("Error while importing. Please try another file.");
} }
else else
{ {
got.Item2.SetOwner(customer.ID); got.Item2.SetOwner(customer.ID);
Settings._instance.addressSets.addresses.Add(got.Item2); Settings._instance.addressSets.addresses.Add(got.Item2);
} }
//var customer_id = int.Parse(LstCustomers.SelectedItem.ToString().Split(" - ")[0]); //var customer_id = int.Parse(LstCustomers.SelectedItem.ToString().Split(" - ")[0]);
RefreshAddressSetListItems(customer.ID); RefreshAddressSetListItems(customer.ID);
} }
} }
Settings.Save(); Settings.Save();
}
catch (Exception ex)
{
Logger.Log($"Error while importing: {ex.Message}", Logger.LogType.Error);
}
} }
public void RefreshAddressSetListItems(int customer_id) public void RefreshAddressSetListItems(int customer_id)
@@ -647,31 +670,38 @@ public partial class MainWindow : Window
private async void BtnSettingsImportCustomerAddressPatch_OnClick(object? sender, RoutedEventArgs e) private async void BtnSettingsImportCustomerAddressPatch_OnClick(object? sender, RoutedEventArgs e)
{ {
if (LstSettingsCustomers.SelectedIndex == null || LstSettingsCustomers.SelectedIndex == -1) return; try
{
if (LstSettingsCustomers.SelectedIndex == null || LstSettingsCustomers.SelectedIndex == -1) return;
var opts = new FilePickerOpenOptions(); var opts = new FilePickerOpenOptions();
opts.Title = "Address-Patch für " + LstSettingsCustomers.SelectedItems[0] + "importieren..."; opts.Title = "Address-Patch für " + LstSettingsCustomers.SelectedItems[0] + "importieren...";
opts.AllowMultiple = false; opts.AllowMultiple = false;
var type = new FilePickerFileType("ADPAC-Dateien (*.adpac)"); var type = new FilePickerFileType("ADPAC-Dateien (*.adpac)");
type.Patterns = new[] { "*.adpac" }; type.Patterns = new[] { "*.adpac" };
opts.FileTypeFilter = new[] { type }; opts.FileTypeFilter = new[] { type };
var paths = await StorageProvider.OpenFilePickerAsync(opts); var paths = await StorageProvider.OpenFilePickerAsync(opts);
if (paths?.Count <= 0) return; if (paths?.Count <= 0) return;
//if (LstSettingsCustomers.SelectedIndex < 0) return; //if (LstSettingsCustomers.SelectedIndex < 0) return;
var selected_path = paths[0].Path; var selected_path = paths[0].Path;
foreach (var customer in Settings._instance.customers.customers) foreach (var customer in Settings._instance.customers.customers)
if (customer.ID == ((Customer)LstSettingsCustomers.SelectedItems[0]).ID) if (customer.ID == ((Customer)LstSettingsCustomers.SelectedItems[0]).ID)
customer.patch = AddressPatch.Import(selected_path); customer.patch = AddressPatch.Import(selected_path);
Settings.Save(); Settings.Save();
} catch (Exception ex)
{
Logger.Log($"Error while importing customer address patch: {ex.Message}", Logger.LogType.Error);
}
} }
private void TbSettingsCustomerCsvSeparator_OnTextChanged(object? sender, TextChangedEventArgs e) private void TbSettingsCustomerCsvSeparator_OnTextChanged(object? sender, TextChangedEventArgs e)
@@ -689,11 +719,14 @@ public partial class MainWindow : Window
catch (FormatException ex) catch (FormatException ex)
{ {
MessageBox.Show(this, "Error while converting: " + ex.Message, "Could not parse"); MessageBox.Show(this, "Error while converting: " + ex.Message, "Could not parse");
Logger.Log($"Error while converting: {ex.Message}", Logger.LogType.Error);
} }
catch (Exception ex) catch (Exception ex)
{ {
MessageBox.Show(this, "Unknown Error: " + ex.Message, "Error"); MessageBox.Show(this, "Unknown Error: " + ex.Message, "Error");
Logger.Log($"Error while converting: {ex.Message}", Logger.LogType.Error);
} }
} }
private void BtnCombineDifference_OnClick(object? sender, RoutedEventArgs e) private void BtnCombineDifference_OnClick(object? sender, RoutedEventArgs e)
@@ -704,10 +737,9 @@ public partial class MainWindow : Window
try try
{ {
StartCombine(list, Convert.ToInt32(LstCustomers.SelectedItem), "difference", GetCombiningTyp()); StartCombine(list, Convert.ToInt32(LstCustomers.SelectedItem), "difference", GetCombiningTyp());
} }catch (Exception ex)
catch
{ {
Logger.Log($"Error while combining (difference): {ex.Message}", Logger.LogType.Error);
} }
} }
@@ -720,9 +752,9 @@ public partial class MainWindow : Window
{ {
StartCombine(list, Convert.ToInt32((LstCustomers.SelectedItem as Customer).ID), "union", GetCombiningTyp()); StartCombine(list, Convert.ToInt32((LstCustomers.SelectedItem as Customer).ID), "union", GetCombiningTyp());
} }
catch catch (Exception ex)
{ {
Logger.Log($"Error while combining (union): {ex.Message}", Logger.LogType.Error);
} }
} }
@@ -736,9 +768,9 @@ public partial class MainWindow : Window
{ {
StartCombine(list, Convert.ToInt32(LstCustomers.SelectedItem.ToString().Split(" - ")[0]), "intersection", GetCombiningTyp()); StartCombine(list, Convert.ToInt32(LstCustomers.SelectedItem.ToString().Split(" - ")[0]), "intersection", GetCombiningTyp());
} }
catch catch (Exception ex)
{ {
Logger.Log($"Error while combining (intersection): {ex.Message}", Logger.LogType.Error);
} }
} }
@@ -815,37 +847,53 @@ public partial class MainWindow : Window
Console.WriteLine("PDF OK"); Console.WriteLine("PDF OK");
} }
} }
catch (Exception ex) catch (Exception ex)
{ {
Console.WriteLine(ex); Logger.Log($"Error while generating labels: {ex.Message}", Logger.LogType.Error);
File.WriteAllText("crash.txt", ex.ToString());
} }
} }
private void HookPdfExportOptionEvents() private void HookPdfExportOptionEvents()
{ {
var controls = GetPdfExportControls(); try
foreach (var control in controls) control.ValueChanged += PdfExportOption_OnValueChanged; {
var controls = GetPdfExportControls();
foreach (var control in controls) control.ValueChanged += PdfExportOption_OnValueChanged;
}
catch (Exception ex)
{
Logger.Log($"Error while hooking pdf export margins: {ex.Message}", Logger.LogType.Error);
}
} }
private void LoadPdfExportOptions() private void LoadPdfExportOptions()
{ {
var options = Settings._instance.pdfExport ?? new PdfExportSettings(); try
{
var options = Settings._instance.pdfExport ?? new PdfExportSettings();
NudExpMargCellPaddingTop.Value = (decimal)options.cellPaddingTopMm; NudExpMargCellPaddingTop.Value = (decimal)options.cellPaddingTopMm;
NudExpMargCellPaddingBot.Value = (decimal)options.cellPaddingBottomMm; NudExpMargCellPaddingBot.Value = (decimal)options.cellPaddingBottomMm;
NudExpMargCellPaddingLeft.Value = (decimal)options.cellPaddingLeftMm; NudExpMargCellPaddingLeft.Value = (decimal)options.cellPaddingLeftMm;
NudExpMargCellPaddingRight.Value = (decimal)options.cellPaddingRightMm; NudExpMargCellPaddingRight.Value = (decimal)options.cellPaddingRightMm;
TbExpMargMarginTop.Value = (decimal)options.pageMarginTopMm; TbExpMargMarginTop.Value = (decimal)options.pageMarginTopMm;
TbExpMargMarginBottom.Value = (decimal)options.pageMarginBottomMm; TbExpMargMarginBottom.Value = (decimal)options.pageMarginBottomMm;
TbExpMargMarginLeft.Value = (decimal)options.pageMarginLeftMm; TbExpMargMarginLeft.Value = (decimal)options.pageMarginLeftMm;
TbExpMargMarginRight.Value = (decimal)options.pageMarginRightMm; TbExpMargMarginRight.Value = (decimal)options.pageMarginRightMm;
TbExpMargRowsPerPage.Value = options.rowsPerPage;
NudExpMargColumnsPerPage.Value = options.columnsPerPage;
NudExpMargFontSize.Value = (decimal)options.fontSize;
NudExpMargSmallFontSize.Value = (decimal)options.smallFontSize;
}
catch (Exception ex)
{
Logger.Log($"Error while loading PDF Export Options: {ex.Message}", Logger.LogType.Error);
}
TbExpMargRowsPerPage.Value = options.rowsPerPage;
NudExpMargColumnsPerPage.Value = options.columnsPerPage;
NudExpMargFontSize.Value = (decimal)options.fontSize;
NudExpMargSmallFontSize.Value = (decimal)options.smallFontSize;
} }
private void SavePdfExportOptions() private void SavePdfExportOptions()
@@ -926,6 +974,7 @@ public partial class MainWindow : Window
public void RefreshCountryView() public void RefreshCountryView()
{ {
if (_suppressCountryRefresh) return; if (_suppressCountryRefresh) return;
try try
{ {
@@ -940,8 +989,9 @@ public partial class MainWindow : Window
{ {
CountryList.Items.Clear(); CountryList.Items.Clear();
} }
catch catch (Exception ex)
{ {
Logger.Log($"Error while clearing country list: {ex.Message}", Logger.LogType.Error);
} }
foreach (var c in Global._instance.countries) CountryList.Items.Add(c.name); foreach (var c in Global._instance.countries) CountryList.Items.Add(c.name);
@@ -949,17 +999,19 @@ public partial class MainWindow : Window
{ {
CountryList.SelectedIndex = country_index; CountryList.SelectedIndex = country_index;
} }
catch catch (Exception ex)
{ {
Logger.Log($"Error while setting selected item: {ex.Message}", Logger.LogType.Error);
} }
try try
{ {
_selectedCountry = Country.GetByName(CountryList.SelectedItems[0].ToString()); _selectedCountry = Country.GetByName(CountryList.SelectedItems[0].ToString());
} }
catch catch (Exception ex)
{ {
_selectedCountry = null; _selectedCountry = null;
Logger.Log($"Error while getting country: {ex.Message}", Logger.LogType.Error);
} }
if (_selectedCountry == null) return; if (_selectedCountry == null) return;
@@ -973,8 +1025,9 @@ public partial class MainWindow : Window
{ {
LbSettingsAlternatives.SelectedIndex = alt_index; LbSettingsAlternatives.SelectedIndex = alt_index;
} }
catch catch (Exception ex)
{ {
Logger.Log($"Error while setting selected item: {ex.Message}", Logger.LogType.Error);
} }
} }
finally finally
@@ -990,9 +1043,9 @@ public partial class MainWindow : Window
{ {
_selectedCountry.alternatives.Remove(selected.ToString()); _selectedCountry.alternatives.Remove(selected.ToString());
} }
catch catch (Exception ex)
{ {
Console.WriteLine("Error while removing country alternative"); Logger.Log($"Error while removing alternatives: {ex.Message}", Logger.LogType.Error);
} }
RefreshCountryView(); RefreshCountryView();
@@ -1067,6 +1120,7 @@ public partial class MainWindow : Window
catch (Exception ex) catch (Exception ex)
{ {
MessageBox.Show(this, ex.StackTrace, "Fehler"); MessageBox.Show(this, ex.StackTrace, "Fehler");
Logger.Log($"Error while adding wiki file: {ex.Message}", Logger.LogType.Error);
} }
} }
@@ -1090,6 +1144,7 @@ public partial class MainWindow : Window
catch (Exception ex) catch (Exception ex)
{ {
MessageBox.Show(this, ex.StackTrace, "Fehler"); MessageBox.Show(this, ex.StackTrace, "Fehler");
Logger.Log($"Error while adding wiki folder: {ex.Message}", Logger.LogType.Error);
} }
} }
@@ -1116,12 +1171,12 @@ public partial class MainWindow : Window
curr_set.Name = result; curr_set.Name = result;
Settings.Save(); Settings.Save();
RefreshAddressSetListItems(cus_id); RefreshAddressSetListItems(cus_id);
return;
} }
} }
catch (Exception ex) catch (Exception ex)
{ {
MessageBox.Show(this, ex.StackTrace, "Fehler"); MessageBox.Show(this, ex.StackTrace, "Fehler");
Logger.Log($"Error while renaming address set: {ex.Message}", Logger.LogType.Error);
} }
} }
@@ -1135,6 +1190,7 @@ public partial class MainWindow : Window
catch (Exception ex) catch (Exception ex)
{ {
MessageBox.Show(this, "Unknown Error: " + ex.Message, "Error"); MessageBox.Show(this, "Unknown Error: " + ex.Message, "Error");
Logger.Log($"Error while deleting customer: {ex.Message}", Logger.LogType.Error);
} }
RefreshCustomerItems(); RefreshCustomerItems();
} }
@@ -1161,9 +1217,9 @@ public partial class MainWindow : Window
TbSettingsCustomerCsvSeparator.Text = div; TbSettingsCustomerCsvSeparator.Text = div;
Settings.Save(); Settings.Save();
} }
catch catch (Exception ex)
{ {
Console.WriteLine("Error while parsing"); Logger.Log($"Error while changing CSV divider: {ex.Message}", Logger.LogType.Error);
} }
} }