mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-06 13:57:54 +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 Polly.Timeout;
|
||||
|
||||
namespace PluralKit.Bot
|
||||
{
|
||||
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 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 :^)
|
||||
if (e is UnknownDiscordRequestException udre && (int) udre.StatusCode >= 500) return false;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue