<commit_before>// --------------------------------------------------------------------
// Imports
// --------------------------------------------------------------------

var common = require('./common.js');

var awlib = require('awlib');
var makeStringBuffer = awlib.objectUtils.stringBuffer;

// --------------------------------------------------------------------
// Private stuff
// --------------------------------------------------------------------

var BuiltinError = Error;

function Error() {
  throw new BuiltinError('Error cannot be instantiated -- it\'s abstract');
}

Error.prototype.getMessage = common.abstract;

Error.prototype.printMessage = function() {
  console.log(this.getMessage());
};

Error.prototype.getShortMessage = function() {
  return this.getMessage();
};

Error.prototype.printShortMessage = function() {
  console.log(this.getMessage());
};

Error.prototype.toString = function() {
  return this.getShortMessage();
};

// ----------------- errors about intervals -----------------

function IntervalSourcesDontMatch() {}<commit_msg>Make our own approach to error messages visible to built-in Error-handling machinery<commit_after>// --------------------------------------------------------------------
// Imports
// --------------------------------------------------------------------

var common = require('./common.js');

var awlib = require('awlib');
var makeStringBuffer = awlib.objectUtils.stringBuffer;

// --------------------------------------------------------------------
// Private stuff
// --------------------------------------------------------------------

var BuiltinError = Error;

function Error() {
  throw new BuiltinError('Error cannot be instantiated -- it\'s abstract');
}

Error.prototype = Object.create(BuiltinError.prototype, {
  message: {
    get: function() {
      return this.getMessage();
    }
  }
});

Error.prototype.getMessage = common.abstract;

Error.prototype.printMessage = function() {
  console.log(this.getMessage());
};

Error.prototype.getShortMessage = function() {
  return this.getMessage();
};

Error.prototype.printShortMessage = function() {
  console.log(this.getMessage());
};

Error.prototype.toString = function() {
  return this.getShortMessage();
};

// ----------------- errors about intervals -----------------

function IntervalSourcesDontMatch() {}
{'fraction_non_alphanumeric': 0.36844349680170574, 'fraction_numerical': 0.0, 'mean_word_length': 1.4878048780487805, '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': '7435205', 'n_tokens_mistral': 513, 'n_tokens_neox': 518, 'n_words': 114}