Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not re throw on a failed Attachment. #1557

Merged
merged 3 commits into from
Mar 29, 2022
Merged

Conversation

lucas-zimerman
Copy link
Collaborator

@lucas-zimerman lucas-zimerman commented Mar 29, 2022

The code behavior from CaptureEnvelope when capturing an event diverges when an attachment fails to get the stream content.

  • With the logger set, the event is sent without the failed attachment and logs a warning about the failed attachment.
  • Without the logger set (Debug = false), the events gets dropped by the failed attachment.

This PR fixes the behavior when debug is set to false by only dropping the failed attachment and not the event.

@lucas-zimerman lucas-zimerman marked this pull request as ready for review March 29, 2022 16:19
Copy link
Member

@bruno-garcia bruno-garcia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We took the original approach on Unity and found ourselves in a bad situation but I rather we make the logger required instead of just logging optionally (e.g: when is it null? why?)

src/Sentry/Envelopes/Envelope.cs Show resolved Hide resolved
@bruno-garcia bruno-garcia merged commit 982f223 into main Mar 29, 2022
@bruno-garcia bruno-garcia deleted the fix/attachment-drop branch March 29, 2022 18:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants