Skip to content

If a user callback beforeAddRecordingEvent throws, don't report SDK internal error #8542

@bruno-garcia

Description

@bruno-garcia

The try block calling the user code:

? replayOptions.beforeAddRecordingEvent(event)

Leads to the catch block that records internal SDK error:

client.recordDroppedEvent('internal_sdk_error', 'replay');

This can make debugging a high number of internal sdk errors

Some ideas:
We could add the invocation to a different try/catch block. Drop the event in case of an error.
Alternatively we could record a breadcrumb:

https://github.com/getsentry/sentry-dotnet/blob/2bee53c4a2ae9bcc72a7f3f72f9675b064849cfb/src/Sentry/SentryClient.cs#L352-L375

Metadata

Metadata

Assignees

No one assigned

    Labels

    Package: replayIssues related to the Sentry Replay SDK

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions