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

Raven intercepts errors even if not installed #320

Closed
basicallydan opened this issue Feb 25, 2015 · 8 comments
Closed

Raven intercepts errors even if not installed #320

basicallydan opened this issue Feb 25, 2015 · 8 comments

Comments

@basicallydan
Copy link

Hey there! Thanks for making Raven and Sentry, they are super awesome, apart from one small issue

We have this bit of code:

    if (settings.APP_SENTRY_DSN) {
        Raven.config(settings.APP_SENTRY_DSN).install();
        Raven.setUserContext({
            id:userId,
            email:userEmail
        });
    }

Basically, we don't config and install raven unless there's a DSN. Whether there's a DSN or not is environment-specific, so we don't have one for local environments, for instance.

However, even if it never gets installed, Raven still seems to be intercepting errors, only we can't see the detail now. All we can see is, in the console:

 <error>

The stacktrace appears to be recursive calls to captureMessage, like so:

errors

It does look like to me that Raven treats lack of config as an error, rather than allowing the error to just continue being thrown. Is that right?

Looking forward to your response :)

@mattrobenolt
Copy link
Contributor

It should be a complete noop if it's not configured. Are you able to reproduce this in a way that I can check it out?

@basicallydan
Copy link
Author

Hmm, perhaps I'm not understanding properly how to use it then. If I don't want Raven to be doing anything, e.g. on a local environment, what is the proper way to disable it?

@mattrobenolt
Copy link
Contributor

You can call config with a falsey DSN value. So an empty string or the value false.

Raven.config(false).install() will succeed, but noop the inner workings so it doesn't actually report.

@joealcorn
Copy link

I looked into this a bit earlier today. I haven't been set up a bare minimum test case, but the issue lies in isSetup calling logDebug with the console plugin enabled, which calls captureMessage, which calls isSetup, etc. In fact, calling Raven.config(false).install() using the latest backbone, console, jquery, native bundle has the same issue

@mattrobenolt
Copy link
Contributor

Ohhh, I can see how that'd happen. :( I'll come up with something to fix that then.

@marcelboettcher
Copy link

@mattrobenolt I'm running in the same problem for the same use case of a local environment. Any progress on this? I agree that Raven should not throw any error when not installed.

Thanks for your good work!

@mattrobenolt
Copy link
Contributor

@marcelboettcher Are you using the console plugin too?

@marcelboettcher
Copy link

@mattrobenolt no, I don't - should I?

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

No branches or pull requests

4 participants