/* global Raven */

import config from '../config/environment';
import Ember from 'ember';

export function initialize() {
  var _onerror;

  Raven.config(config.sentry.dsn, {
    whitelistUrls: config.sentry.whitelistUrls
  }).install();

  _onerror = Ember.onerror;
  Ember.onerror = function(error){
    Raven.captureException(error);
    if (typeof _onerror === 'function') {
      _onerror.call(this, error);
    }
  }

  Ember.RSVP.configure('onerror', function(error){
    Raven.captureException(error);
  });
}

export default {
  name: 'sentry-setup',
  initialize: initialize
};

/* global Raven */

import config from '../config/environment';
import Ember from 'ember';

export function initialize() {
  // Disable for development
  if (config.sentry.development) {
    return;
  }

  var _onerror;

  Raven.config(config.sentry.dsn, {
    whitelistUrls: config.sentry.whitelistUrls
  }).install();

  _onerror = Ember.onerror;
  Ember.onerror = function(error){
    Raven.captureException(error);
    if (typeof _onerror === 'function') {
      _onerror.call(this, error);
    }
  }

  Ember.RSVP.configure('onerror', function(error){
    Raven.captureException(error);
  });
}

export default {
  name: 'sentry-setup',
  initialize: initialize
};

Check if we want to disable and return
Check if we want to disable and return