mirror of
https://github.com/Tyrrrz/DiscordChatExporter.git
synced 2026-05-05 12:03:35 +00:00
@@ -13,10 +13,11 @@ public static class Http
|
|||||||
{
|
{
|
||||||
public static HttpClient Client { get; } = new();
|
public static HttpClient Client { get; } = new();
|
||||||
|
|
||||||
private static bool IsRetryableStatusCode(HttpStatusCode statusCode) => statusCode is
|
private static bool IsRetryableStatusCode(HttpStatusCode statusCode) =>
|
||||||
HttpStatusCode.TooManyRequests or
|
statusCode is HttpStatusCode.TooManyRequests or HttpStatusCode.RequestTimeout ||
|
||||||
HttpStatusCode.RequestTimeout or
|
// Treat all server-side errors as retryable.
|
||||||
HttpStatusCode.InternalServerError;
|
// https://github.com/Tyrrrz/DiscordChatExporter/issues/908
|
||||||
|
(int)statusCode >= 500;
|
||||||
|
|
||||||
private static bool IsRetryableException(Exception exception) =>
|
private static bool IsRetryableException(Exception exception) =>
|
||||||
exception.GetSelfAndChildren().Any(ex =>
|
exception.GetSelfAndChildren().Any(ex =>
|
||||||
|
|||||||
Reference in New Issue
Block a user