-
-
Notifications
You must be signed in to change notification settings - Fork 341
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
feat: Add Attachments in beforeSend #1460
Comments
Hints could be its own class extending a dictionary with methods for adding an attachment. Before implementing this we still need to investigate the use cases of hints in the Cocoa SDK. Look at Python and Android. How this could look like with hints: SentrySDK.start { options in
options.beforeSend { event, hint in
hint.addAttachment(Attachment())
hint.removeAttachment()
hint.attachments
}
} |
How can we add attachments to any sort of crashes at all? We have logs that would be helpful in identifying why a crash happened and can't figure out how to send it. |
@eric, sadly that is currently not possible. We could add an API for capturing attachemts; then you could do SentrySDK.start { options in
// ...
options.onCrashedLastRun = { event in
SentrySDK.captureAttachment(...)
}
} But I think the proper way would be adding hints to the SDK, so you can do this in |
What if we use the following existing api, what is the expected behavior?
|
@tmm1, your approach could work, but SentrySDK.start { options in
// ...
options.onCrashedLastRun = { event in
SentrySDK.configureScope { scope in
scope.clearAttachments()
}
}
}
SentrySDK.configureScope { scope in
scope.addAttachment(...)
} |
Currently, adding attachments in beforeSend is not possible, because the Cocoa SDK doesn't have hints as for example, Python does. Either we add hints or the SDK should offer another way of adding attachments in beforeSend. Furthermore, it would be nice to also drop attachments in beforeSend.
This came up in #1459. A user wants to add an attachment to an OOM event.
The text was updated successfully, but these errors were encountered: