From cc1ad8b435b6adbe9216f255145faf0ae42446eb Mon Sep 17 00:00:00 2001 From: Tyrrrz <1935960+Tyrrrz@users.noreply.github.com> Date: Fri, 16 Sep 2022 22:47:02 +0300 Subject: [PATCH] Retry on SSL exceptions --- DiscordChatExporter.Core/Utils/Http.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/DiscordChatExporter.Core/Utils/Http.cs b/DiscordChatExporter.Core/Utils/Http.cs index 9e60133..77ae52a 100644 --- a/DiscordChatExporter.Core/Utils/Http.cs +++ b/DiscordChatExporter.Core/Utils/Http.cs @@ -3,6 +3,7 @@ using System.Linq; using System.Net; using System.Net.Http; using System.Net.Sockets; +using System.Security.Authentication; using System.Threading.Tasks; using DiscordChatExporter.Core.Utils.Extensions; using Polly; @@ -21,7 +22,7 @@ public static class Http private static bool IsRetryableException(Exception exception) => exception.GetSelfAndChildren().Any(ex => - ex is TimeoutException or SocketException || + ex is TimeoutException or SocketException or AuthenticationException || ex is HttpRequestException hrex && IsRetryableStatusCode(hrex.TryGetStatusCode() ?? HttpStatusCode.OK) );