/** * ErrorInfo type from @fjell/core * Re-exported for convenience */ 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; }; 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; availablePermissions?: string[]; }; details?: { validOptions?: string[]; suggestedAction?: string; retryable?: boolean; conflictingValue?: any; expectedValue?: any; }; technical?: { timestamp: string; requestId?: string; stackTrace?: string; cause?: any; }; } /** * HTTP error that preserves Fjell error information from server responses */ export declare class FjellHttpError extends Error { readonly fjellError: ErrorInfo; readonly httpResponseCode: number; readonly requestInfo?: { method: string; url: string; headers?: Record; body?: any; } | undefined; readonly name = "FjellHttpError"; constructor(message: string, fjellError: ErrorInfo, httpResponseCode: number, requestInfo?: { method: string; url: string; headers?: Record; body?: any; } | undefined); /** * Get a user-friendly error message with context */ getUserMessage(): string; /** * Check if the error is retryable */ isRetryable(): boolean; /** * Get the error code */ getCode(): string; /** * Convert to JSON for logging */ toJSON(): { name: string; message: string; fjellError: ErrorInfo; httpResponseCode: number; requestInfo: { method: string; url: string; headers?: Record; body?: any; } | undefined; }; } /** * Type guard to check if an error is a FjellHttpError */ export declare function isFjellHttpError(error: any): error is FjellHttpError; /** * Helper to extract error info from various error types */ export declare function extractErrorInfo(error: any): ErrorInfo | null;