mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-04 04:56:49 +00:00
Ignore weird Nginx errors from Discord
This commit is contained in:
parent
b9a89a1037
commit
dee229b08c
1 changed files with 5 additions and 0 deletions
|
|
@ -30,6 +30,11 @@ namespace PluralKit.Bot
|
|||
// The library tries to parse these HTML responses as JSON and crashes with a consistent exception message.
|
||||
if (e is JsonReaderException jre && jre.Message == "Unexpected character encountered while parsing value: <. Path '', line 0, position 0.") return false;
|
||||
|
||||
// And now (2020-05-12), apparently Discord returns these weird responses occasionally. Also not our problem.
|
||||
if (e is BadRequestException bre && bre.WebResponse.Response.Contains("<center>nginx</center>")) return false;
|
||||
if (e is NotFoundException ne && ne.WebResponse.Response.Contains("<center>nginx</center>")) return false;
|
||||
if (e is UnauthorizedException ue && ue.WebResponse.Response.Contains("<center>nginx</center>")) return false;
|
||||
|
||||
// Webhook server errors are also *not our problem*
|
||||
// (this includes rate limit errors, WebhookRateLimited is a subclass)
|
||||
if (e is WebhookExecutionErrorOnDiscordsEnd) return false;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue