var ExtendableBuiltin = require("./extendablebuiltin");
var inherits = require("util").inherits;

inherits(ExtendableError, ExtendableBuiltin(Error));

// From: http://stackoverflow.com/questions/31089801/extending-error-in-javascript-with-es6-syntax
function ExtendableError(message) {
  ExtendableError.super_.call(this);
  this.message = message;
  this.stack = (new Error()).stack;
  this.name = this.constructor.name;
};

// Hack. Likely won't be formatted correctly when there are
// 10 or more errors. But if there's 10 or more errors, I'm guessing
// formatting won't matter so much.
ExtendableError.prototype.formatForMocha = function() {
  this.message = this.message.replace(/\n/g, "\n     ");
};

module.exports = ExtendableError;

var ExtendableBuiltin = require("./extendablebuiltin");
var inherits = require("util").inherits;

inherits(ExtendableError, ExtendableBuiltin(Error));

// From: http://stackoverflow.com/questions/31089801/extending-error-in-javascript-with-es6-syntax
function ExtendableError(message) {
  ExtendableError.super_.call(this);
  this.message = message;
  this.stack = (new Error(message)).stack;
  this.name = this.constructor.name;
};

// Hack. Likely won't be formatted correctly when there are
// 10 or more errors. But if there's 10 or more errors, I'm guessing
// formatting won't matter so much.
ExtendableError.prototype.formatForMocha = function() {
  this.message = this.message.replace(/\n/g, "\n     ");
};

module.exports = ExtendableError;

Revert "We don't need the message here."
Revert "We don't need the message here."

This reverts commit 8a63b900a07216b157e4a6e234f4ff10ac9bd6e2.
