<commit_before>var fs = require('fs'),
    pathUtil = require('path'),
    _ = require('underscore'),
    async = require('async'),
    getDependencies = require('./getDependencies');

var _module,
    _modules,
    requireRegEx = /=( *)require\(['"](.*)['"]\)/g;

function loadFiles(filesToLoad, finalCallback) {
    var loadedFiles = {},
        pending = 0,
        isFilesToLoadRunning = false;

    function loadFile(path, callback) {
        function finished(err) {
            pending--;
            if (!isFilesToLoadRunning) {
                processFilesToLoad();
            }
            if (err) {
                console.log("Loaded files before error: ");
                console.log(loadedFiles);
                callback(err);
            } else {
                callback(null);
            }<commit_msg>improved error reporting<commit_after>var fs = require('fs'),
    pathUtil = require('path'),
    _ = require('underscore'),
    async = require('async'),
    getDependencies = require('./getDependencies');

var _module,
    _modules,
    requireRegEx = /=( *)require\(['"](.*)['"]\)/g;

function loadFiles(filesToLoad, finalCallback) {
    var loadedFiles = {},
        pending = 0,
        isFilesToLoadRunning = false;

    function loadFile(path, callback) {
        function finished(err) {
            pending--;
            if (!isFilesToLoadRunning) {
                processFilesToLoad();
            }
            if (err) {
                console.log("Loaded files before error: ");
                console.log(Object.keys(loadedFiles));
                callback(err);
            } else {
                callback(null);
            }
{'fraction_non_alphanumeric': 0.13832335329341316, 'fraction_numerical': 0.0011976047904191617, 'mean_word_length': 1.9010416666666667, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '4285797', 'n_tokens_mistral': 455, 'n_tokens_neox': 432, 'n_words': 88}