From 0261076021c87be9f9031cb502a90fddd60a4395 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Domeradzki?= Date: Fri, 13 Jan 2023 10:40:37 +0100 Subject: [PATCH] Ignore QUIC exceptions (#2800) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Ignore QUIC exceptions See https://github.com/dotnet/runtime/issues/80111 * Update madness * No i jaki jest twój problem ja się pytam --- ArchiSteamFarm/Program.cs | 10 ++++++++-- Directory.Build.props | 1 + 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/ArchiSteamFarm/Program.cs b/ArchiSteamFarm/Program.cs index 7385f8aa5..603783f1f 100644 --- a/ArchiSteamFarm/Program.cs +++ b/ArchiSteamFarm/Program.cs @@ -4,7 +4,7 @@ // / ___ \ | | | (__ | | | || | ___) || |_| __/| (_| || | | | | || _|| (_| || | | | | | | | // /_/ \_\|_| \___||_| |_||_||____/ \__|\___| \__,_||_| |_| |_||_| \__,_||_| |_| |_| |_| // | -// Copyright 2015-2022 Łukasz "JustArchi" Domeradzki +// Copyright 2015-2023 Łukasz "JustArchi" Domeradzki // Contact: JustArchi@JustArchi.net // | // Licensed under the Apache License, Version 2.0 (the "License"); @@ -43,6 +43,9 @@ using Newtonsoft.Json; using NLog; using NLog.Targets; using SteamKit2; +#if !NETFRAMEWORK +using System.Net.Quic; +#endif namespace ArchiSteamFarm; @@ -539,7 +542,10 @@ internal static class Program { 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(); diff --git a/Directory.Build.props b/Directory.Build.props index 3ce4327e6..a4d3ceb99 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -56,6 +56,7 @@ +