Remove unimportant UnobservedTaskException #1691
Some checks failed
MSBuild / build (push) Has been cancelled
MSBuild / publish (push) Has been cancelled

This commit is contained in:
ema
2025-08-06 00:19:47 +08:00
parent 139cb873f2
commit 3dbc9fc763

View File

@@ -117,22 +117,8 @@ public partial class App : Application
// Exception handling events which are not caught in the Task thread
TaskScheduler.UnobservedTaskException += (_, e) =>
{
try
{
ProcessHelper.WriteLog(e.Exception.ToString());
Current?.Dispatcher?.BeginInvoke(() =>
{
Wpf.Ui.Violeta.Controls.ExceptionReport.Show(e.Exception);
});
}
catch (Exception ex)
{
ProcessHelper.WriteLog(ex.ToString());
}
finally
{
e.SetObserved();
}
ProcessHelper.WriteLog(e.Exception.ToString());
e.SetObserved();
};
// Exception handling events which are not caught in UI thread