<commit_before>import { ICON_LOADED } from '../constants/actionTypes';
import getNativeIcon from 'lib/getNativeIcon';

/**
 * Action to read and and save in store native OSx icon for file
 * @param  {String} path to file
 * @return {Object}  redux action
 */
export function loadIcon(path) {
  return (dispatch) => {
    getNativeIcon(path).then(icon => {
      dispatch({
        type: ICON_LOADED,
        payload: {
          path,
          icon,
        }
      });
    });
  };
}<commit_msg>Do not raise errors when icon can't be fetched<commit_after>import { ICON_LOADED } from '../constants/actionTypes';
import getNativeIcon from 'lib/getNativeIcon';

/**
 * Action to read and and save in store native OSx icon for file
 * @param  {String} path to file
 * @return {Object}  redux action
 */
export function loadIcon(path) {
  return (dispatch) => {
    getNativeIcon(path).then(icon => {
      dispatch({
        type: ICON_LOADED,
        payload: {
          path,
          icon,
        }
      });
    }).catch(() => {
      // Icon can't be fetched
    });
  };
}
{'fraction_non_alphanumeric': 0.12882298424467098, 'fraction_numerical': 0.0, 'mean_word_length': 2.4394904458598727, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 8, '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': '1837791', 'n_tokens_mistral': 333, 'n_tokens_neox': 327, 'n_words': 97}