flysh
Version:
DOM Document Object Artifact Collector
72 lines • 2.15 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.FlyshException = void 0;
/**
* 'FlyshException' Exception Class Definition
*
* This class is instanciated and thrown in case of error. Inherits from the native TypeScript framework 'Error' class
*
*/
class FlyshException extends Error {
errorID;
/**
* Class constants
*/
CLASS_INSTANCE_NAME_VALUE = 'FlyshException';
CLASS_INSTANCE_LINKED_FLYSH_INSTANCE_ID_VALUE = -1;
/**
* Class properties
*/
_error_id;
_instance_id = this.CLASS_INSTANCE_LINKED_FLYSH_INSTANCE_ID_VALUE;
_name = this.CLASS_INSTANCE_NAME_VALUE;
/**
* Constructor
*
* @param errorID Refers to the exception ID value
* @param err 'Error' type message
* @param message Internal 'error' message
* @param instanceID Linked 'Flysh' instance ID
*/
constructor(errorID, err, message, instanceID) {
super(err.message);
this.errorID = errorID;
this._error_id = errorID;
this._instance_id = instanceID;
this.message = message + "\n" + "Cause : " + this.message;
}
/**
* Getter 'errorIDNumber'
*
* @returns Returns a 'string' that constains the '_error_id' class property
*/
get errorIDNumber() {
return this._error_id;
}
/**
* Getter 'instanceID'
*
* @returns Returns a 'string' that contains the '_instance_ID' number class property or 'undefined'
*/
get instanceID() {
return this._instance_id;
}
/**
* Getter 'name'
*
* @returns Returns a 'string' that contains the '_name' class property
*/
get name() {
return this._name;
}
/**
* Overrides 'toString()' used by the inherited 'stack' function
*
* @returns Returns a 'string' that displays all the class instance's properties
*/
toString = () => {
return 'Exception ID: ' + this._error_id + ' (Flysh ID: ' + this._instance_id + ')' + '\n' + 'Stack : ' + this.stack;
};
}
exports.FlyshException = FlyshException;
//# sourceMappingURL=FlyshException.js.map