Browse Source

Tell the user we're crashing at the moment

CPKreuz 2 years ago
parent
commit
861330062a
1 changed files with 12 additions and 1 deletions
  1. 12 1
      src/PixiEditor/Helpers/CrashHelper.cs

+ 12 - 1
src/PixiEditor/Helpers/CrashHelper.cs

@@ -3,9 +3,11 @@ using System.IO;
 using System.Net.Http;
 using System.Runtime.CompilerServices;
 using System.Text;
+using System.Windows.Input;
 using ByteSizeLib;
 using Hardware.Info;
 using PixiEditor.Models.DataHolders;
+using Mouse = System.Windows.Input.Mouse;
 
 namespace PixiEditor.Helpers;
 
@@ -15,7 +17,16 @@ internal class CrashHelper
 
     public static void SaveCrashInfo(Exception exception)
     {
-        CrashReport report = CrashReport.Generate(exception);
+        try
+        {
+            Mouse.OverrideCursor = Cursors.Wait;
+        }
+        catch (Exception e)
+        {
+            exception = new AggregateException(exception, e);
+        }
+        
+        var report = CrashReport.Generate(exception);
         report.TrySave();
         report.RestartToCrashReport();
     }