Skip to content

Commit

Permalink
Ignore QUIC exceptions
Browse files Browse the repository at this point in the history
  • Loading branch information
JustArchi committed Jan 12, 2023
1 parent ac5cd5c commit 8b3945c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion ArchiSteamFarm/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
using System.Globalization;
using System.IO;
using System.Linq;
using System.Net.Quic;
using System.Reflection;
using System.Runtime.InteropServices;
using System.Text;
Expand Down Expand Up @@ -539,7 +540,10 @@ private static async void OnUnobservedTaskException(object? sender, UnobservedTa
ArgumentNullException.ThrowIfNull(e);
ArgumentNullException.ThrowIfNull(e.Exception);

await ASF.ArchiLogger.LogFatalException(e.Exception).ConfigureAwait(false);
// TODO: Remove conditionally ignoring QuicException once https://github.com/dotnet/runtime/issues/80111 is resolved
if (e.Exception.InnerExceptions.All(static exception => exception is not QuicException)) {
await ASF.ArchiLogger.LogFatalException(e.Exception).ConfigureAwait(false);
}

// Normally we should abort the application, but due to the fact that unobserved exceptions do not have to do that, it's a better idea to log it and try to continue
e.SetObserved();
Expand Down

0 comments on commit 8b3945c

Please sign in to comment.