UNPKG

@fjell/core

Version:

Core Item and Key Framework for Fjell

53 lines (52 loc) 1.43 kB
export interface ErrorInfo { code: string; message: string; operation: { type: 'get' | 'create' | 'update' | 'remove' | 'upsert' | 'all' | 'one' | 'find' | 'findOne' | 'action' | 'allAction' | 'facet' | 'allFacet'; name: string; params: Record<string, any>; }; context: { itemType: string; key?: { primary?: string | number; composite?: { sk: string | number; kta: string[]; locations?: Array<{ lk: string | number; kt: string; }>; }; }; affectedItems?: Array<{ id: string | number; type: string; displayName?: string; }>; parentLocation?: { id: string | number; type: string; }; requiredPermission?: string; }; details?: { validOptions?: string[]; suggestedAction?: string; retryable?: boolean; conflictingValue?: any; expectedValue?: any; fieldErrors?: any[]; }; technical?: { timestamp: string; requestId?: string; stackTrace?: string; cause?: any; }; } export declare class ActionError extends Error { readonly errorInfo: ErrorInfo; constructor(errorInfo: ErrorInfo, cause?: Error); toJSON(): ErrorInfo; }