How to use the raven-js._globalOptions function in raven-js

To help you get started, we’ve selected a few raven-js examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github getsentry / sentry-react-native / lib / RavenClient.js View on Github external
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;
        }
      }
    );
github hypothesis / client / src / sidebar / raven.js View on Github external
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');
}
github hypothesis / client / src / sidebar / raven.js View on Github external
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');
github getsentry / sentry-javascript / packages / browser / lib / SentryBrowser.ts View on Github external
public async setOptions(options: ISentryBrowserOptions) {
    Object.assign(this.options, options);
    Object.assign(Raven._globalOptions, this.options);
    return this;
  }