<commit_before>import * as Sentry from '@sentry/browser';
import { apiRequest } from 'platform/utilities/api';
import { transform } from '../utils/helpers';

export const MCP_STATEMENTS_FETCH_INIT = 'MCP_STATEMENTS_FETCH_INIT';
export const MCP_STATEMENTS_FETCH_SUCCESS = 'MCP_STATEMENTS_FETCH_SUCCESS';
export const MCP_STATEMENTS_FETCH_FAILURE = 'MCP_STATEMENTS_FETCH_FAILURE';

export const getStatements = () => {
  return dispatch => {
    dispatch({ type: MCP_STATEMENTS_FETCH_INIT });
    return apiRequest('/medical_copays')
      .then(({ data }) => {
        return dispatch({
          type: MCP_STATEMENTS_FETCH_SUCCESS,
          response: transform(data),
        });
      })
      .catch(({ errors }) => {
        Sentry.captureException(errors);
        Sentry.captureMessage('medical_copays getStatements failed');
        return dispatch({
          type: MCP_STATEMENTS_FETCH_FAILURE,
          errors,
        });
      });
  };
};<commit_msg>31627: [MCP] sentry config (#19134)<commit_after>import * as Sentry from '@sentry/browser';
import { apiRequest } from 'platform/utilities/api';
import { transform } from '../utils/helpers';

export const MCP_STATEMENTS_FETCH_INIT = 'MCP_STATEMENTS_FETCH_INIT';
export const MCP_STATEMENTS_FETCH_SUCCESS = 'MCP_STATEMENTS_FETCH_SUCCESS';
export const MCP_STATEMENTS_FETCH_FAILURE = 'MCP_STATEMENTS_FETCH_FAILURE';

export const getStatements = () => {
  return dispatch => {
    dispatch({ type: MCP_STATEMENTS_FETCH_INIT });
    return apiRequest('/medical_copays')
      .then(({ data }) => {
        return dispatch({
          type: MCP_STATEMENTS_FETCH_SUCCESS,
          response: transform(data),
        });
      })
      .catch(errors => {
        Sentry.withScope(scope => {
          scope.setExtra('errors', errors);
          Sentry.captureMessage('medical_copays getStatements failed');
        });
        return dispatch({
          type: MCP_STATEMENTS_FETCH_FAILURE,
          errors,
        });
      });
  };
};
{'fraction_non_alphanumeric': 0.11967951927891837, 'fraction_numerical': 0.005007511266900351, 'mean_word_length': 3.296774193548387, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 12, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4257083', 'n_tokens_mistral': 646, 'n_tokens_neox': 611, 'n_words': 113}