@prismicio/custom-types-client
Version:
JavaScript client to interact with the Prismic Custom Types API
58 lines (57 loc) • 1.91 kB
JavaScript
;
var __defProp = Object.defineProperty;
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
var __publicField = (obj, key, value) => {
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
return value;
};
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
class PrismicError extends Error {
/**
* Creates a new `PrismicError`.
*
* @param message - A description of the error.
* @param args - Metadata about the failed network request.
*
* @returns A `PrismicError` for the given error state.
*/
constructor(message, args) {
super(message);
/**
* The Prismic Custom Types API URL used for the failed request.
*/
__publicField(this, "url");
/**
* The Prismic Custom Types API response from the failed request.
*/
__publicField(this, "response");
this.url = args.url;
this.response = args.response;
}
}
class InvalidAPIResponse extends PrismicError {
}
class UnauthorizedError extends PrismicError {
}
class ForbiddenError extends PrismicError {
}
class ConflictError extends PrismicError {
}
class NotFoundError extends PrismicError {
}
class InvalidPayloadError extends PrismicError {
}
class BulkUpdateHasExistingDocumentsError extends PrismicError {
}
class MissingFetchError extends Error {
}
exports.BulkUpdateHasExistingDocumentsError = BulkUpdateHasExistingDocumentsError;
exports.ConflictError = ConflictError;
exports.ForbiddenError = ForbiddenError;
exports.InvalidAPIResponse = InvalidAPIResponse;
exports.InvalidPayloadError = InvalidPayloadError;
exports.MissingFetchError = MissingFetchError;
exports.NotFoundError = NotFoundError;
exports.PrismicError = PrismicError;
exports.UnauthorizedError = UnauthorizedError;
//# sourceMappingURL=errors.cjs.map