From 5ba0ad8eedbe96b79cb43758701912d07791f678 Mon Sep 17 00:00:00 2001 From: Archi Date: Tue, 23 Nov 2021 10:47:33 +0100 Subject: [PATCH] Hide https://github.com/dotnet/runtime/issues/60856 --- ArchiSteamFarm/Program.cs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/ArchiSteamFarm/Program.cs b/ArchiSteamFarm/Program.cs index c1696136d..e289bb11f 100644 --- a/ArchiSteamFarm/Program.cs +++ b/ArchiSteamFarm/Program.cs @@ -472,10 +472,16 @@ internal static class Program { throw new ArgumentNullException(nameof(e)); } + // TODO: Silence https://github.com/dotnet/runtime/issues/60856 - pending for removal (after verification) in 6.0.1+ + if (e.Exception.InnerExceptions.All(static exception => exception is TimeoutException timeoutException && string.IsNullOrEmpty(timeoutException.StackTrace))) { + e.SetObserved(); + + return; + } + await ASF.ArchiLogger.LogFatalException(e.Exception).ConfigureAwait(false); - // Normally we should abort the application here, but many tasks are in fact failing in SK2 code which we can't easily fix - // Thanks Valve. + // 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(); }