UNPKG

c8osdkjscore

Version:
56 lines 2.06 kB
"use strict"; var __extends = (this && this.__extends) || (function () { var extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); Object.defineProperty(exports, "__esModule", { value: true }); var C8oException = (function (_super) { __extends(C8oException, _super); function C8oException(message, cause, all) { if (cause === void 0) { cause = null; } if (all === void 0) { all = false; } var _this = this; if (cause == null) { _this = _super.call(this, message) || this; _this.message = message; Object.setPrototypeOf(_this, C8oException.prototype); } else { _this = _super.call(this, message) || this; _this.message = message; _this._cause = cause; Object.setPrototypeOf(_this, C8oException.prototype); } return _this; } Object.defineProperty(C8oException.prototype, "cause", { get: function () { return this._cause; }, enumerable: true, configurable: true }); C8oException.prototype.toJSON = function () { var alt = {}; Object.getOwnPropertyNames(this).forEach(function (key) { alt[key] = this[key]; }, this); return alt; }; C8oException.prototype.toString = function () { var alt = {}; Object.getOwnPropertyNames(this).forEach(function (key) { alt[key] = this[key]; }, this); return alt; }; return C8oException; }(Error)); exports.C8oException = C8oException; //# sourceMappingURL=c8oException.js.map