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

(Warning) Push scope called in global mode, returning. #446

Closed
ripperdoc opened this issue Dec 6, 2021 · 3 comments
Closed

(Warning) Push scope called in global mode, returning. #446

ripperdoc opened this issue Dec 6, 2021 · 3 comments
Assignees
Labels
Bug Something isn't working

Comments

@ripperdoc
Copy link

ripperdoc commented Dec 6, 2021

Environment

How do you use Sentry?
Sentry SaaS (sentry.io)

Which SDK and version?
Sentry Unity 0.6.2

Steps to Reproduce

If I follow the example in docs for local scope with attachments I get a warning, and the message doesn't make it clear what I need to change. The example:

// Local Scope
SentrySdk.WithScope(scope =>
{
    scope.AddAttachment("log.txt");

    SentrySdk.CaptureMessage("my message");
});

Expected Result

No warning.

Actual Result

I get a warning:

Sentry: (Warning) Push scope called in global mode, returning. 
UnityEngine.Debug:LogWarning (object)
Sentry.Unity.UnityLogger:Log (Sentry.SentryLevel,string,System.Exception,object[]) (at /Users/runner/work/sentry-unity/sentry-unity/src/Sentry.Unity/UnityLogger.cs:44)
Sentry.Extensibility.DiagnosticLoggerExtensions:LogIfEnabled (Sentry.Extensibility.IDiagnosticLogger,Sentry.SentryLevel,System.Exception,string)
Sentry.Extensibility.DiagnosticLoggerExtensions:LogWarning (Sentry.SentryOptions,string)
Sentry.Internal.SentryScopeManager:PushScope<object> (object)
Sentry.Internal.SentryScopeManager:PushScope ()
Sentry.Internal.SentryScopeManager:WithScope (System.Action`1<Sentry.Scope>)
Sentry.Internal.Hub:WithScope (System.Action`1<Sentry.Scope>)
Sentry.SentrySdk:WithScope (System.Action`1<Sentry.Scope>)
SettingsPopup/<>c:<Awake>b__31_6 () (at Assets/Scripts/UI/SettingsPopup.cs:78)
UnityEngine.XR.Interaction.Toolkit.UI.UIInputModule:Update () (at Library/PackageCache/com.unity.xr.interaction.toolkit@1.0.0-pre.8/Runtime/UI/UIInputModule.cs:109)
@ripperdoc ripperdoc changed the title Sentry: (Warning) Push scope called in global mode, returning. (Warning) Push scope called in global mode, returning. Dec 6, 2021
@bitsandfoxes
Copy link
Contributor

Hey @ripperdoc, thanks for raising this. We'll look into it in conjunction with #448

@bitsandfoxes bitsandfoxes added the Bug Something isn't working label Dec 6, 2021
@bruno-garcia
Copy link
Member

The alternative API is tracked here:

@bruno-garcia
Copy link
Member

Closing this as we removed the WithScope API from docs and this PR (getsentry/sentry-dotnet#1412) will introduce an alternative API. The warning is by design.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working
Projects
Archived in project
Development

No branches or pull requests

3 participants