Disable logging synchronizer exceptions to sentry.

This commit is contained in:
Burak Kaan Köse
2026-02-08 19:43:13 +01:00
parent 22c6452227
commit 1747ed84a8
+6 -1
View File
@@ -3,6 +3,7 @@ using Sentry;
using Serilog;
using Serilog.Core;
using Serilog.Exceptions;
using Wino.Core.Domain.Exceptions;
using Wino.Core.Domain.Interfaces;
namespace Wino.Services;
@@ -47,9 +48,13 @@ public class WinoLogger : IWinoLogger
#endif
options.AutoSessionTracking = true;
// Set user context
// Set user context and filter out known exceptions.
options.SetBeforeSend((sentryEvent, hint) =>
{
// Don't send synchronization failure exceptions to Sentry.
if (sentryEvent.Exception is SynchronizerException)
return null;
sentryEvent.User = new SentryUser
{
Id = _preferencesService.DiagnosticId