Skip to content

Commit

Permalink
Apparently .NET code itself can throw UnobservedTaskException (e.g., d…
Browse files Browse the repository at this point in the history
…otnet/runtime#80116), so let's not forcefully terminate JL just because an UnobservedTaskException is thrown
  • Loading branch information
rampaa committed Sep 17, 2024
1 parent a50ad7b commit 9f783db
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions JL.Windows/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -62,18 +62,18 @@ private bool IsSingleInstance()
return true;
}

private void LogUnhandledException(object sender, UnhandledExceptionEventArgs args)
private static void LogUnhandledException(object sender, UnhandledExceptionEventArgs args)
{
Utils.Logger.Fatal((Exception)args.ExceptionObject, "Unhandled exception");
if (!args.IsTerminating)
{
Shutdown();
}
//if (!args.IsTerminating)
//{
// Shutdown();
//}
}

private void LogUnobservedTaskException(object? sender, UnobservedTaskExceptionEventArgs args)
private static void LogUnobservedTaskException(object? sender, UnobservedTaskExceptionEventArgs args)
{
Utils.Logger.Fatal(args.Exception, "Unobserved task exception");
Shutdown();
// Shutdown();
}
}

0 comments on commit 9f783db

Please sign in to comment.