UNPKG

@botonic/plugin-contentful

Version:

## What Does This Plugin Do?

37 lines (36 loc) 1.44 kB
import { ResourceId } from './callback'; import { ResourceType } from './cms'; export declare class CmsException extends Error { readonly reason?: any; readonly resourceId?: ResourceId | undefined; /** * @param message description of the problem * @param reason what caused the exception (normally a low level exception) */ constructor(message: string, reason?: any, resourceId?: ResourceId | undefined); messageFromReason(): string | undefined; /** * Reason's string is merged into message because many tools (eg. jest) * only report Error.message and not Error.toString() */ private static mergeMessages; } export declare class ResourceNotFoundCmsException extends CmsException { readonly resourceId?: ResourceId | undefined; readonly reason?: any; constructor(resourceId?: ResourceId | undefined, reason?: any); } export declare class ResourceTypeNotFoundCmsException extends CmsException { readonly resourceType: ResourceType; readonly reason: any | undefined; constructor(resourceType: ResourceType, reason: any | undefined); } export declare function ensureError(e: any): Error; export declare class ExceptionUnpacker { readonly indent: string; readonly prependSubErrorIndex: boolean; constructor(indent?: string, prependSubErrorIndex?: boolean); unpack(e: any): string[]; private getMultiError; private processException; }