mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
Log exception instead of reporting
This commit is contained in:
parent
6b54ca28b0
commit
2582a9fa20
1 changed files with 4 additions and 3 deletions
|
|
@ -1,10 +1,10 @@
|
|||
using System;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using System.Windows.Threading;
|
||||
using Flow.Launcher.Infrastructure;
|
||||
using Flow.Launcher.Infrastructure.Exception;
|
||||
using Flow.Launcher.Infrastructure.Logger;
|
||||
using NLog;
|
||||
|
||||
namespace Flow.Launcher.Helper;
|
||||
|
|
@ -36,8 +36,9 @@ public static class ErrorReporting
|
|||
|
||||
public static void TaskSchedulerUnobservedTaskException(object sender, UnobservedTaskExceptionEventArgs e)
|
||||
{
|
||||
// handle unobserved task exceptions on UI thread
|
||||
Application.Current.Dispatcher.Invoke(() => Report(e.Exception, true));
|
||||
// log exception but do not handle unobserved task exceptions on UI thread
|
||||
//Application.Current.Dispatcher.Invoke(() => Report(e.Exception, true));
|
||||
Log.Exception(nameof(ErrorReporting), "Unobserved task exception occurred.", e.Exception);
|
||||
// prevent application exit, so the user can copy the prompted error info
|
||||
e.SetObserved();
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue