UNPKG

@agnostack/verifyd

Version:

Please contact agnoStack via info@agnostack.com for any questions

35 lines 1.52 kB
"use strict"; var __rest = (this && this.__rest) || function (s, e) { var t = {}; for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p]; if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]]; } return t; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.VerificationError = exports.PreconditionError = void 0; class PreconditionError extends Error { constructor(message, _data) { super(message); const _a = _data !== null && _data !== void 0 ? _data : {}, { code = 412 } = _a, data = __rest(_a, ["code"]); this.code = code; this.data = data; this.name = 'PreconditionError'; Object.setPrototypeOf(this, PreconditionError.prototype); } } exports.PreconditionError = PreconditionError; class VerificationError extends PreconditionError { constructor(message, _data) { const _a = _data !== null && _data !== void 0 ? _data : {}, { code = 500 } = _a, data = __rest(_a, ["code"]); super(message, Object.assign({ code }, data)); this.name = 'VerificationError'; Object.setPrototypeOf(this, VerificationError.prototype); } } exports.VerificationError = VerificationError; //# sourceMappingURL=errors.js.map