From cddecb7558c127ba438d324e6feac7070941403c Mon Sep 17 00:00:00 2001 From: Ske Date: Thu, 18 Mar 2021 20:16:28 +0100 Subject: [PATCH] Upgrade exception filter --- PluralKit.Bot/Utils/MiscUtils.cs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/PluralKit.Bot/Utils/MiscUtils.cs b/PluralKit.Bot/Utils/MiscUtils.cs index 041f7ae7..abd373c0 100644 --- a/PluralKit.Bot/Utils/MiscUtils.cs +++ b/PluralKit.Bot/Utils/MiscUtils.cs @@ -12,6 +12,8 @@ using Npgsql; using PluralKit.Core; +using Polly.Timeout; + namespace PluralKit.Bot { public static class MiscUtils { @@ -68,6 +70,11 @@ namespace PluralKit.Bot if (e is NotFoundException ne && ne.ResponseBody.Contains("
nginx
")) return false; if (e is UnauthorizedException ue && ue.ResponseBody.Contains("
nginx
")) return false; + // Filter out timeout/ratelimit related stuff + if (e is TooManyRequestsException) return false; + if (e is RatelimitBucketExhaustedException) return false; + if (e is TimeoutRejectedException) return false; + // 5xxs? also not our problem :^) if (e is UnknownDiscordRequestException udre && (int) udre.StatusCode >= 500) return false;