<commit_before>define(['config', 'http-helper'], function(Config, HttpHelper) {
  var RdioApi = function(settings) {
    var _config = {};

    _.extend(_config, Config);

    if(settings !== undefined) {
      _.extend(_config, settings);
    }

    var httpHelper = new HttpHelper(_config);

    this.getEndpoint = function() {
      return _config.endpoint;
    };

    this.execute = function(method, args, callback) {
      httpHelper.post(method, args, function(data) {
        if(data[1].status !== 'ok') {
          callback({
            status: data[1].status,
            message: data[1].message
          });
        } else {
          callback({
            error: data[0],
            status: data[1].status,
            result: data[1].result
          });
        }
      });
    };
  };

  return RdioApi;
});<commit_msg>fixed error handling<commit_after>define(['config', 'http-helper'], function(Config, HttpHelper) {
  var RdioApi = function(settings) {
    var _config = {};

    _.extend(_config, Config);

    if(settings !== undefined) {
      _.extend(_config, settings);
    }

    var httpHelper = new HttpHelper(_config);

    this.getEndpoint = function() {
      return _config.endpoint;
    };

    this.execute = function(method, args, callback) {
      httpHelper.post(method, args, function(data) {
        if(data[0] !== null) {
          callback({
            error: data[0]
          });
        } else {
          callback(data[1]);
        }
      });
    };
  };

  return RdioApi;
});
{'fraction_non_alphanumeric': 0.15062213490504256, 'fraction_numerical': 0.005893909626719057, 'mean_word_length': 2.1120162932790225, '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': '3780242', 'n_tokens_mistral': 456, 'n_tokens_neox': 439, 'n_words': 88}