de
Version:
Simple asynchronous promise-based controller
48 lines (38 loc) • 816 B
JavaScript
;
/**
* @class Exception
* @extends Error
*
* @param {*} [message]
* */
function Exception (message) {
var stack;
/**
* @public
* @memberOf {Exception}
* @property {String}
* */
this.message = void 0 === message ? '' : String(message);
stack = ( new Error() ).stack;
stack = [ String(this) ].concat( stack.split('\n').slice(2) ).join('\n');
/**
* @public
* @memberOf {Exception}
* @property {String}
* */
this.stack = stack;
}
Exception.prototype = Object.create(Error.prototype);
/**
* @protected
* @memberOf {Exception}
* @method
* */
Exception.prototype.constructor = Exception;
/**
* @public
* @memberOf {Exception}
* @property {String}
* */
Exception.prototype.name = 'Exception';
module.exports = Exception;