Skip to content

Commit

Permalink
Show inner exception in error dialog
Browse files Browse the repository at this point in the history
  • Loading branch information
pizzaboxer committed Jul 15, 2023
1 parent e3cf2ac commit e4dc6c0
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Bloxstrap/UI/Elements/ExceptionDialog.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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";

Expand Down

0 comments on commit e4dc6c0

Please sign in to comment.