<commit_before>var request = require('request'),
    log     = require('./log');

/**
 * SimianReporter Constructor
 *
 * @param {Object} options
 * @api public
 */
function SimianReporter (options) {
  this.options = options;

  // FIXME: We need a way to isolate instance in jest tests, until then this allows asserions
  SimianReporter.instance = this;
}

SimianReporter.prototype.report = function (result, callback) {

  var url = require('url').format({
    protocol: 'http',
    host: this.options.simianResultEndPoint,
    query: {
      accessToken: this.options.simianAccessToken
    }
  });
<commit_msg>improved error handling and reporting<commit_after>var request = require('request'),
    log     = require('./log');

/**
 * SimianReporter Constructor
 *
 * @param {Object} options
 * @api public
 */
function SimianReporter (options) {
  this.options = options;

  // FIXME: We need a way to isolate instance in jest tests, until then this allows asserions
  SimianReporter.instance = this;
}

SimianReporter.prototype.report = function (result, callback) {

  var url = require('url').format({
    protocol: 'http',
    host: this.options.simianResultEndPoint,
    query: {
      accessToken: this.options.simianAccessToken
    }
  });

  if (!result.length) {
    console.error('[chimp][simian-reporter]', result);
    callback(result);
    return;
  }

{'fraction_non_alphanumeric': 0.12700729927007298, 'fraction_numerical': 0.0, 'mean_word_length': 3.6161616161616164, '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': '883577', 'n_tokens_mistral': 417, 'n_tokens_neox': 410, 'n_words': 108}