From e4dc6c0600a1c7f5c393401c758576d10cbd0e71 Mon Sep 17 00:00:00 2001 From: pizzaboxer Date: Sat, 15 Jul 2023 16:20:28 +0100 Subject: [PATCH] Show inner exception in error dialog --- Bloxstrap/UI/Elements/ExceptionDialog.xaml.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Bloxstrap/UI/Elements/ExceptionDialog.xaml.cs b/Bloxstrap/UI/Elements/ExceptionDialog.xaml.cs index 1af61aa7..2b71bcb7 100644 --- a/Bloxstrap/UI/Elements/ExceptionDialog.xaml.cs +++ b/Bloxstrap/UI/Elements/ExceptionDialog.xaml.cs @@ -18,11 +18,16 @@ public partial class ExceptionDialog { public ExceptionDialog(Exception exception) { + Exception? innerException = exception.InnerException; + InitializeComponent(); Title = RootTitleBar.Title = $"{App.ProjectName} Exception"; ErrorRichTextBox.Selection.Text = $"{exception.GetType()}: {exception.Message}"; + if (innerException is not null) + ErrorRichTextBox.Selection.Text += $"\n\n===== Inner Exception =====\n{innerException.GetType()}: {innerException.Message}"; + if (!App.Logger.Initialized) LocateLogFileButton.Content = "Copy log contents";