<commit_before>import request from "browser-request";

const url = "https://beta.accesslint.com/api/v1/reports";

export default function (message) {
  const violations = message.violations;

  if (violations.length > 0) {
    let descriptions = [];

    violations.map((violation) => {
      descriptions.push(violation.help);
    });

    request({
      method: "POST",
      url: url,
      json: message,
    }, function() {});

    throw new Error(
      `AccessLintError: ${violations.length} violations:` + "\n" +
      descriptions.join(",\n")
    );
  }
}
<commit_msg>Use console.error instead of throw<commit_after>import request from "browser-request";

const url = "https://beta.accesslint.com/api/v1/reports";

export default function (message) {
  const violations = message.violations;

  if (violations.length > 0) {
    request({
      method: "POST",
      url: url,
      json: message,
    }, function() {});

    console.error(
      `AccessLint - ${violations.length} accessibility violations:`,
      violations
    );
  }
}

{'fraction_non_alphanumeric': 0.14871306005719734, 'fraction_numerical': 0.0038131553860819827, 'mean_word_length': 2.977272727272727, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 6, 'https://': 2, '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': '6388255', 'n_tokens_mistral': 339, 'n_tokens_neox': 320, 'n_words': 72}