mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-15 02:00:09 +00:00
Upgrade exception filter
This commit is contained in:
parent
3196f60093
commit
cddecb7558
1 changed files with 7 additions and 0 deletions
|
|
@ -12,6 +12,8 @@ using Npgsql;
|
||||||
|
|
||||||
using PluralKit.Core;
|
using PluralKit.Core;
|
||||||
|
|
||||||
|
using Polly.Timeout;
|
||||||
|
|
||||||
namespace PluralKit.Bot
|
namespace PluralKit.Bot
|
||||||
{
|
{
|
||||||
public static class MiscUtils {
|
public static class MiscUtils {
|
||||||
|
|
@ -68,6 +70,11 @@ namespace PluralKit.Bot
|
||||||
if (e is NotFoundException ne && ne.ResponseBody.Contains("<center>nginx</center>")) return false;
|
if (e is NotFoundException ne && ne.ResponseBody.Contains("<center>nginx</center>")) return false;
|
||||||
if (e is UnauthorizedException ue && ue.ResponseBody.Contains("<center>nginx</center>")) return false;
|
if (e is UnauthorizedException ue && ue.ResponseBody.Contains("<center>nginx</center>")) 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 :^)
|
// 5xxs? also not our problem :^)
|
||||||
if (e is UnknownDiscordRequestException udre && (int) udre.StatusCode >= 500) return false;
|
if (e is UnknownDiscordRequestException udre && (int) udre.StatusCode >= 500) return false;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue