enigma-bbs/core/enig_error.js

19 lines
384 B
JavaScript
Raw Normal View History

2016-08-27 03:29:57 +00:00
/* jslint node: true */
'use strict';
class EnigError extends Error {
constructor(message) {
super(message);
this.name = this.constructor.name;
this.message = message;
if(typeof Error.captureStackTrace === 'function') {
Error.captureStackTrace(this, this.constructor);
} else {
this.stack = (new Error(message)).stack;
}
}
}
exports.EnigError = EnigError;