From 2aae3575b4400876e8d2c552abc046966b3f87b9 Mon Sep 17 00:00:00 2001 From: Michael Babienco Date: Sat, 3 Jan 2026 22:31:20 +0900 Subject: [PATCH] Log crashes --- ViewModels/MainViewModel.cs | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/ViewModels/MainViewModel.cs b/ViewModels/MainViewModel.cs index ad7ddeb..c0b0428 100644 --- a/ViewModels/MainViewModel.cs +++ b/ViewModels/MainViewModel.cs @@ -60,7 +60,25 @@ class MainViewModel : BaseViewModel, IFontResolver LogInfo("Chosen folder: " + folder.Path.LocalPath); if (Directory.Exists(folder.Path.LocalPath)) { - await Task.Run(() => CreatePDF(folder.Path.LocalPath)); + try + { + await Task.Run(() => CreatePDF(folder.Path.LocalPath)); + } catch (Exception e) + { + LogInfo("PDF process failed! Reason: " + e.Message); + if (e.StackTrace != null) + { + LogInfo(e.StackTrace); + } + if (e.InnerException != null) + { + LogInfo("Inner exception: " + e.InnerException.Message); + if (e.InnerException.StackTrace != null) + { + LogInfo(e.InnerException.StackTrace); + } + } + } } } }