Skip to content

feat: Combine attachAllThreads with scope block - #9424

Draft
sentry-junior[bot] wants to merge 3 commits into
mainfrom
feat/attach-all-threads-scope-block
Draft

sentry-junior[bot] wants to merge 3 commits into
mainfrom
feat/attach-all-threads-scope-block

Conversation

@sentry-junior

@sentry-junior sentry-junior Bot commented Oct 22, 2026

Copy link
Copy Markdown
Contributor

Adds capture(…:attachAllThreads:block:) overloads for events, errors, exceptions, and messages, so a single call can attach all threads and mutate a per-call scope (for example, adding tags to a custom app hang report).

Today attachAllThreads and the scope block are separate overloads, so callers have to either enable attachAllThreads globally or set tags via configureScope and clean them up afterwards.

The new methods clone the current scope, apply the block, and forward the attachAllThreads override, same as the existing hint:block: variants. They're also exposed through SentryObjC (captureError:attachAllThreads:withScopeBlock: etc.).

SentrySDK.capture(error: error, attachAllThreads: true) { scope in
    scope.setTag(value: "hang", key: "type")
}

Draft because sdk_api.json, sdk_api_objc.json, and sdk_api_objc_v10.json still need regenerating with make generate-public-api on macOS.

Closes #8538

via ADV.

--

View Junior Session [Sentry]

sentry-junior Bot and others added 2 commits October 22, 2026 14:39
Add capture overloads for events, errors, exceptions, and messages
that accept both a per-call attachAllThreads override and a scope
block, in Swift and through SentryObjC.

Co-Authored-By: Angelo de Voer <angelo.devoer@sentry.io>
Co-Authored-By: Angelo de Voer <angelo.devoer@sentry.io>
@github-actions

github-actions Bot commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor
Messages
📖 Do not forget to update Sentry-docs with your feature once the pull request gets approved.

Generated by 🚫 dangerJS against 5813999

Regenerate the API snapshots for the new capture overloads, using the
output of the API Stability check.

This branch has not been deployed

No deployments
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.

Add capture(error:attachAllThreads:block:) combined API to SentrySDK

0 participants