UNPKG

@prismicio/custom-types-client

Version:

JavaScript client to interact with the Prismic Custom Types API

58 lines (57 loc) 1.59 kB
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; }; 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 { } export { BulkUpdateHasExistingDocumentsError, ConflictError, ForbiddenError, InvalidAPIResponse, InvalidPayloadError, MissingFetchError, NotFoundError, PrismicError, UnauthorizedError }; //# sourceMappingURL=errors.js.map