fix(bot): clean up "not found in cache" errors in sentry

This commit is contained in:
alyssa 2025-02-24 10:53:18 +00:00
parent 63777bf810
commit d74a6678c8
3 changed files with 22 additions and 2 deletions

View file

@ -213,6 +213,13 @@ public class Bot
{
_metrics.Measure.Meter.Mark(BotMetrics.BotErrors, exc.GetType().FullName);
if (exc is Myriad.Extensions.NotFoundInCacheException ce)
{
var scope = serviceScope.Resolve<Scope>();
scope.SetTag("entity.id", ce.EntityId.ToString());
scope.SetTag("entity.type", ce.EntityType);
}
// Make this beforehand so we can access the event ID for logging
var sentryEvent = new SentryEvent(exc);