Skip to content

Commit 2582a9f

Browse files
committed
Log exception instead of reporting
1 parent 6b54ca2 commit 2582a9f

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

Flow.Launcher/Helper/ErrorReporting.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
using System;
22
using System.Runtime.CompilerServices;
33
using System.Threading.Tasks;
4-
using System.Windows;
54
using System.Windows.Threading;
65
using Flow.Launcher.Infrastructure;
76
using Flow.Launcher.Infrastructure.Exception;
7+
using Flow.Launcher.Infrastructure.Logger;
88
using NLog;
99

1010
namespace Flow.Launcher.Helper;
@@ -36,8 +36,9 @@ public static void DispatcherUnhandledException(object sender, DispatcherUnhandl
3636

3737
public static void TaskSchedulerUnobservedTaskException(object sender, UnobservedTaskExceptionEventArgs e)
3838
{
39-
// handle unobserved task exceptions on UI thread
40-
Application.Current.Dispatcher.Invoke(() => Report(e.Exception, true));
39+
// log exception but do not handle unobserved task exceptions on UI thread
40+
//Application.Current.Dispatcher.Invoke(() => Report(e.Exception, true));
41+
Log.Exception(nameof(ErrorReporting), "Unobserved task exception occurred.", e.Exception);
4142
// prevent application exit, so the user can copy the prompted error info
4243
e.SetObserved();
4344
}

0 commit comments

Comments
 (0)