Skip to content

Do not re throw on a failed Attachment. - #1557

Merged
bruno-garcia merged 3 commits into
mainfrom
fix/attachment-drop
Mar 29, 2022
Merged

bruno-garcia merged 3 commits into
mainfrom
fix/attachment-drop

Conversation

@lucas-zimerman

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

Copy link
Copy Markdown
Collaborator

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

@bruno-garcia bruno-garcia left a comment

Copy link
Copy Markdown
Member

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?)

Comment thread src/Sentry/Envelopes/Envelope.cs 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