On the IHub methods like CaptureEvent, CaptureMessage and CaptureException should have an overload that takes: Action<Scope>.
The implementation should do what WithScope does, it pushes a scope, and passes the instance to the callback to be mutated. The result is then applied (normal code path of CaptureEvent(event, scope).
This serves as a replacement to the api:
SentrySdk.WithScope(s =>
{
s...;
// Odd call to static method in callback. Data passed magically through the callback
SentrySdk.CaptureX
});
This exists on sentry-cocoa:
https://github.com/getsentry/sentry-cocoa/blob/29d1e9f2353f1a9514b2549b1de56e83f136658d/Sources/Sentry/SentrySDK.m#L146-L151
On the
IHubmethods likeCaptureEvent,CaptureMessageandCaptureExceptionshould have an overload that takes:Action<Scope>.The implementation should do what
WithScopedoes, it pushes a scope, and passes the instance to the callback to be mutated. The result is then applied (normal code path ofCaptureEvent(event, scope).This serves as a replacement to the api:
This exists on
sentry-cocoa:https://github.com/getsentry/sentry-cocoa/blob/29d1e9f2353f1a9514b2549b1de56e83f136658d/Sources/Sentry/SentrySDK.m#L146-L151