1 | var ExtendableBuiltin = require("./extendablebuiltin");
|
2 | var inherits = require("util").inherits;
|
3 |
|
4 | inherits(ExtendableError, ExtendableBuiltin(Error));
|
5 |
|
6 |
|
7 | function ExtendableError(message) {
|
8 | ExtendableError.super_.call(this);
|
9 | this.message = message;
|
10 | this.stack = new Error(message).stack;
|
11 | this.name = this.constructor.name;
|
12 | }
|
13 |
|
14 |
|
15 |
|
16 |
|
17 | ExtendableError.prototype.formatForMocha = function() {
|
18 | this.message = this.message.replace(/\n/g, "\n ");
|
19 | };
|
20 |
|
21 | module.exports = ExtendableError;
|