mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-09 07:17:56 +00:00
run dotnet format
This commit is contained in:
parent
05989242f9
commit
ac2671452d
278 changed files with 1913 additions and 1808 deletions
|
|
@ -16,10 +16,11 @@ using Polly.Timeout;
|
|||
|
||||
namespace PluralKit.Bot
|
||||
{
|
||||
public static class MiscUtils {
|
||||
public static string ProxyTagsString(this PKMember member, string separator = ", ") =>
|
||||
public static class MiscUtils
|
||||
{
|
||||
public static string ProxyTagsString(this PKMember member, string separator = ", ") =>
|
||||
string.Join(separator, member.ProxyTags.Select(t => t.ProxyString.AsCode()));
|
||||
|
||||
|
||||
public static bool IsOurProblem(this Exception e)
|
||||
{
|
||||
// This function filters out sporadic errors out of our control from being reported to Sentry
|
||||
|
|
@ -40,24 +41,24 @@ namespace PluralKit.Bot
|
|||
if (e is TimeoutRejectedException) return false;
|
||||
|
||||
// 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;
|
||||
|
||||
// Webhook server errors are also *not our problem*
|
||||
// (this includes rate limit errors, WebhookRateLimited is a subclass)
|
||||
if (e is WebhookExecutionErrorOnDiscordsEnd) return false;
|
||||
|
||||
|
||||
// Socket errors are *not our problem*
|
||||
if (e.GetBaseException() is SocketException) return false;
|
||||
|
||||
|
||||
// Tasks being cancelled for whatver reason are, you guessed it, also not our problem.
|
||||
if (e is TaskCanceledException) return false;
|
||||
|
||||
// Sometimes Discord just times everything out.
|
||||
if (e is TimeoutException) return false;
|
||||
|
||||
|
||||
// Ignore "Database is shutting down" error
|
||||
if (e is PostgresException pe && pe.SqlState == "57P03") return false;
|
||||
|
||||
|
||||
// Ignore thread pool exhaustion errors
|
||||
if (e is NpgsqlException npe && npe.Message.Contains("The connection pool has been exhausted")) return false;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue