@foxy.io/sdk
Version:
Universal SDK for a full server-side and a limited in-browser access to Foxy hAPI.
27 lines (26 loc) • 961 B
JavaScript
;
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.ResolutionError = void 0;
const cross_fetch_1 = require("cross-fetch");
const v8n_1 = __importDefault(require("v8n"));
/**
* This error is thrown when one of the requests for a resource
* in a path returns a non-2XX status code during the URL resolution process.
* If you're implementing a custom resolver, consider using this class
* to indicate resolution errors.
*/
class ResolutionError extends Error {
constructor(response) {
super();
ResolutionError.v8n.constructor.check(response);
this.response = response;
}
}
exports.ResolutionError = ResolutionError;
/** Available class member validators. */
ResolutionError.v8n = {
constructor: v8n_1.default().instanceOf(cross_fetch_1.Response),
};