feat: remove DiscordRequestObserver

This commit is contained in:
spiral
2021-11-02 05:34:17 -04:00
parent f78d4844e2
commit 14b0e98791
6 changed files with 87 additions and 210 deletions

View File

@@ -227,8 +227,6 @@ namespace PluralKit.Bot
// Make this beforehand so we can access the event ID for logging
var sentryEvent = new SentryEvent(exc);
_logger.Error(exc, "Exception in event handler: {SentryEventId}", sentryEvent.EventId);
// If the event is us responding to our own error messages, don't bother logging
if (evt is MessageCreateEvent mc && mc.Author.Id == shard.User?.Id)
return;
@@ -236,6 +234,9 @@ namespace PluralKit.Bot
var shouldReport = exc.IsOurProblem();
if (shouldReport)
{
// only log exceptions if they're our problem
_logger.Error(exc, "Exception in event handler: {SentryEventId}", sentryEvent.EventId);
// Report error to Sentry
// This will just no-op if there's no URL set
var sentryScope = serviceScope.Resolve<Scope>();