{"size": 718, "ext": "js", "max_stars_repo_path": "src/client/services/raven-service.js", "max_stars_repo_name": "dlepaux/mithril-light-framework", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "src/client/services/raven-service.js", "max_issues_repo_name": "dlepaux/mithril-light-framework", "max_issues_repo_issues_event_min_datetime": "2019-09-17T14:21:10.000Z", "max_issues_repo_issues_event_max_datetime": "2019-09-17T14:21:10.000Z", "max_forks_repo_path": "src/client/services/raven-service.js", "max_forks_repo_name": "dlepaux/mithril-isomorphic-demonstrator", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": 1, "max_forks_count": null, "avg_line_length": 19.4054054054, "max_line_length": 88, "alphanum_fraction": 0.6267409471}
import Sentry from 'raven';

/**
 * Report function error
 * @param  {String} functionName
 * @param  {Object} e             Error event
 * @param  {Object} detail        Extra info
 */
const functionReport = (functionName, error, detail) => {
  console.log('Error inside function', functionName, error);
  Sentry.captureMessage('Error inside function', {
    level: 'error',
    extra: {
      functionName,
      error,
      detail
    }
  });
};

/**
 * Init module
 */
const init = callback => {
  Sentry.config('https://2603fdab672e4cdb837fab34b2b3081d@sentry.io/1423885').install();
  Sentry.context(() => {
    callback();
  });
};

const sentryService = {
  functionReport,
  init
};

export {sentryService};
