Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
install() {
// we have to remove the sampleRate if native client is available
// otherwise we will sample twice
if (Sentry.isNativeClientAvailable() && this.options.sampleRate !== undefined) {
Raven._globalOptions.sampleRate = 1;
}
Raven.install();
Raven.addPlugin(
require('./raven-plugin'),
{
nativeClientAvailable: Sentry.isNativeClientAvailable(),
handlePromiseRejection: this.options.handlePromiseRejection
},
data => {
if (Sentry.options.internal) {
data.dist = Sentry.options.internal.dist;
}
}
);
function angularModule(angular) {
const prevCallback = Raven._globalOptions.dataCallback;
angularPlugin(Raven, angular);
// Hack: Ensure that both our data callback and the one provided by
// the Angular plugin are run when submitting errors.
//
// The Angular plugin replaces any previously installed
// data callback with its own which does not in turn call the
// previously registered callback that we registered when calling
// Raven.config().
//
// See https://github.com/getsentry/raven-js/issues/522
const angularCallback = Raven._globalOptions.dataCallback;
Raven.setDataCallback(function(data) {
return angularCallback(prevCallback(data));
});
return angular.module('ngRaven');
}
function angularModule(angular) {
const prevCallback = Raven._globalOptions.dataCallback;
angularPlugin(Raven, angular);
// Hack: Ensure that both our data callback and the one provided by
// the Angular plugin are run when submitting errors.
//
// The Angular plugin replaces any previously installed
// data callback with its own which does not in turn call the
// previously registered callback that we registered when calling
// Raven.config().
//
// See https://github.com/getsentry/raven-js/issues/522
const angularCallback = Raven._globalOptions.dataCallback;
Raven.setDataCallback(function(data) {
return angularCallback(prevCallback(data));
});
return angular.module('ngRaven');
public async setOptions(options: ISentryBrowserOptions) {
Object.assign(this.options, options);
Object.assign(Raven._globalOptions, this.options);
return this;
}