Enigma error objects

This commit is contained in:
Bryan Ashby 2016-08-26 21:29:57 -06:00
parent 6fa19f9ac3
commit 8d484daa3a
1 changed files with 19 additions and 0 deletions

19
core/enig_error.js Normal file
View File

@ -0,0 +1,19 @@
/* 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;