hydrate-mongodb
Version:
An Object Document Mapper (ODM) for MongoDB.
26 lines (25 loc) • 728 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
var ErrorBase = (function () {
function ErrorBase(message, cause) {
this.name = "Error";
Error.call(this, message);
if (cause) {
this._cause = cause;
}
this.message = message;
if (Error.captureStackTrace) {
Error.captureStackTrace(this, this.constructor);
}
else {
this.stack = new Error(message).stack;
}
}
return ErrorBase;
}());
exports.ErrorBase = ErrorBase;
ErrorBase.prototype = Object.create(Error.prototype);
ErrorBase.prototype.constructor = ErrorBase;
ErrorBase.prototype.cause = function () {
return this._cause;
};