zumokit
Version:
ZumoKit is a Wallet as a Service SDK
38 lines (37 loc) • 1.46 kB
JavaScript
;
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
return extendStatics(d, b);
};
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 });
exports.ZumoKitError = void 0;
/**
* ZumoKitError extension to Error class with type, code and message properties.
* Refer to <a href="https://developers.zumo.money/docs/guides/handling-errors">Handling Errors</a>
* guide for details on handling errors.
*/
var ZumoKitError = /** @class */ (function (_super) {
__extends(ZumoKitError, _super);
/** @internal */
function ZumoKitError(json) {
var _this = this;
var error = JSON.parse(json);
_this = _super.call(this, error.message) || this;
_this.name = 'ZumoKitError';
_this.type = error.type;
_this.code = error.code;
_this.message = error.message;
return _this;
}
return ZumoKitError;
}(Error));
exports.ZumoKitError = ZumoKitError;