Disable sentry on dev environment when using angular plugin
See original GitHub issueAt the moment it is not possible to disable the sentry plugin because the ngRaven module fails to load.
On the development environment I use the following without providing the DSN Raven.config().install()
The callback that registers the raven provider is not called
Raven.addPlugin(function () {
angular.module('ngRaven', [])
.provider('Raven', RavenProvider)
.config(['$provide', ExceptionHandlerProvider]);
});
Because the install function does not call the plugin that installs the module isSetup() failed because the globalServer is null
install: function() {
if (isSetup() && !isRavenInstalled) {
TraceKit.report.subscribe(handleStackInfo);
// Install all of the plugins
each(plugins, function(_, plugin) {
plugin();
});
isRavenInstalled = true;
}
return Raven;
},
Issue Analytics
- State:
- Created 8 years ago
- Comments:15 (6 by maintainers)
Top Results From Across the Web
Disable Sentry in Angular application at runtime - SDKs
The thing I'm looking for is to disable Sentry after it has been initialised … Sentry. getCurrentHub(). getClient().
Read more >Angular with Sentry — A Step-by-Step Guide - Medium
In this article, we will see how to integrate Sentry in our Angular application to track errors. Let's start then.
Read more >Tracking errors in Angular with Sentry - DEV Community
Sentry is an open-source error tracking solution that'll allow you to log errors beyond the browser console. You can run your own server...
Read more >JavaScript - Docs - Sentry Documentation
js", sourceMapFilename: "[name].js.map" } // other configuration };. In case you use SourceMapDevToolPlugin for more fine- ...
Read more >sentry Changelog - PyUp.io
Use new SDK identifier `sentry.javascript.react-native` ... fix(angular): Add check for global.location in angular universal (4513) - fix(nextjs): Stop ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I had a similar request from @benvinegar and he pointed out that you can use:
And that will stop Raven from reporting. Switch the
return
status to TRUE and it will start reporting. At least this is what I’ve been told. We plan to use this plus a deploymentsed
command to flip the boolean at deployment time.I have used this way. It seems working for me
`if (environment.production) { Raven.config(‘https://<key>@sentry.io/<project>’) .install(); }
and in providers providers: [environment.production ? { provide: ErrorHandler, useClass: RavenErrorHandler } : [], …`
Please let me know if I am doing anything wrong here.