From b5ce54144086291da7663075397aa66f727702eb Mon Sep 17 00:00:00 2001 From: Ske Date: Thu, 12 Aug 2021 02:52:29 +0200 Subject: [PATCH] Avoid spamming failed proxy checks in edit handler logs --- PluralKit.Bot/Handlers/MessageEdited.cs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/PluralKit.Bot/Handlers/MessageEdited.cs b/PluralKit.Bot/Handlers/MessageEdited.cs index cb38032b..3a4a99d4 100644 --- a/PluralKit.Bot/Handlers/MessageEdited.cs +++ b/PluralKit.Bot/Handlers/MessageEdited.cs @@ -69,7 +69,14 @@ namespace PluralKit.Bot var equivalentEvt = await GetMessageCreateEvent(evt, lastMessage, channel); var botPermissions = _bot.PermissionsIn(channel.Id); - await _proxy.HandleIncomingMessage(shard, equivalentEvt, ctx, allowAutoproxy: false, guild: guild, channel: channel, botPermissions: botPermissions); + + try + { + await _proxy.HandleIncomingMessage(shard, equivalentEvt, ctx, allowAutoproxy: false, guild: guild, + channel: channel, botPermissions: botPermissions); + } + // Catch any failed proxy checks so they get ignored in the global error handler + catch (ProxyService.ProxyChecksFailedException) {} } private async Task GetMessageCreateEvent(MessageUpdateEvent evt, CachedMessage lastMessage, Channel channel)