Disable logging synchronizer exceptions to sentry.
This commit is contained in:
@@ -3,6 +3,7 @@ using Sentry;
|
|||||||
using Serilog;
|
using Serilog;
|
||||||
using Serilog.Core;
|
using Serilog.Core;
|
||||||
using Serilog.Exceptions;
|
using Serilog.Exceptions;
|
||||||
|
using Wino.Core.Domain.Exceptions;
|
||||||
using Wino.Core.Domain.Interfaces;
|
using Wino.Core.Domain.Interfaces;
|
||||||
|
|
||||||
namespace Wino.Services;
|
namespace Wino.Services;
|
||||||
@@ -47,9 +48,13 @@ public class WinoLogger : IWinoLogger
|
|||||||
#endif
|
#endif
|
||||||
options.AutoSessionTracking = true;
|
options.AutoSessionTracking = true;
|
||||||
|
|
||||||
// Set user context
|
// Set user context and filter out known exceptions.
|
||||||
options.SetBeforeSend((sentryEvent, hint) =>
|
options.SetBeforeSend((sentryEvent, hint) =>
|
||||||
{
|
{
|
||||||
|
// Don't send synchronization failure exceptions to Sentry.
|
||||||
|
if (sentryEvent.Exception is SynchronizerException)
|
||||||
|
return null;
|
||||||
|
|
||||||
sentryEvent.User = new SentryUser
|
sentryEvent.User = new SentryUser
|
||||||
{
|
{
|
||||||
Id = _preferencesService.DiagnosticId
|
Id = _preferencesService.DiagnosticId
|
||||||
|
|||||||
Reference in New Issue
Block a user