flysh
Version:
DOM Document Object Artifact Collector
63 lines • 2.01 kB
JavaScript
/**
* 'FlyshException' class model
*
* This class is instanciated and thrown in case of error. Inherits from the native TypeScript framework 'Error' class
*
*/
export class FlyshException extends Error {
/**
* 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;
/**
* Class constants
*/
this.CLASS_INSTANCE_NAME_VALUE = 'FlyshException';
this.CLASS_INSTANCE_LINKED_FLYSH_INSTANCE_ID_VALUE = -1;
this._instance_id = this.CLASS_INSTANCE_LINKED_FLYSH_INSTANCE_ID_VALUE;
this._name = this.CLASS_INSTANCE_NAME_VALUE;
/**
* Overrides 'toString()' used by the inherited 'stack' function
*
* @returns Returns a 'string' that displays all the class instance's properties
*/
this.toString = () => {
return 'Exception ID: ' + this._error_id + ' (Flysh ID: ' + this._instance_id + ')' + '\n' + 'Stack : ' + this.stack;
};
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;
}
}
//# sourceMappingURL=FlyshException.js.map