From 8bb3bc2316fc6f68a65091a0e783d6c09900e053 Mon Sep 17 00:00:00 2001 From: Gadfly Date: Fri, 28 Jun 2024 10:11:26 +0800 Subject: [PATCH] fix: log InnerException to crash log --- src/App.axaml.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/App.axaml.cs b/src/App.axaml.cs index 927d1d57..0b319792 100644 --- a/src/App.axaml.cs +++ b/src/App.axaml.cs @@ -61,6 +61,12 @@ namespace SourceGit builder.Append($"Source: {ex.Source}\n"); builder.Append($"---------------------------\n\n"); builder.Append(ex.StackTrace); + while (ex.InnerException != null) + { + ex = ex.InnerException; + builder.Append($"\n\nInnerException::: {ex.GetType().FullName}: {ex.Message}\n"); + builder.Append(ex.StackTrace); + } var time = DateTime.Now.ToString("yyyy-MM-dd_HH-mm-ss"); var file = Path.Combine(Native.OS.DataDir, $"crash_{time}.log");