UNPKG

@zhanghongping/json-sage-workflow-cli

Version:

An intelligent JSON processing workflow system with improved error handling and configuration

30 lines (29 loc) 942 B
export declare class ApiError extends Error { statusCode: number; constructor(statusCode: number, message: string); } export declare class RetryableError extends Error { constructor(message: string); } export declare class JsonSageError extends Error { code: string; details?: any | undefined; constructor(message: string, code: string, details?: any | undefined); } export declare function safeJsonParse(data: string): { success: boolean; data?: any; error?: Error; }; export declare function safeExecute<T>(fn: () => Promise<T> | T, errorMessage?: string): Promise<{ success: boolean; data?: T; error?: Error; }>; export declare function retryWithBackoff<T>(operation: () => Promise<T>, options?: { maxRetries?: number; initialDelay?: number; maxDelay?: number; shouldRetry?: (error: any) => boolean; }): Promise<T>; export declare function handleApiError(error: any): never;