mirror of
https://github.com/NuSkooler/enigma-bbs.git
synced 2025-06-10 14:44:40 +02:00
Enigma error objects
This commit is contained in:
parent
6fa19f9ac3
commit
8d484daa3a
1 changed files with 19 additions and 0 deletions
19
core/enig_error.js
Normal file
19
core/enig_error.js
Normal 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;
|
Loading…
Add table
Add a link
Reference in a new issue