/** * Shared Error Handling Utilities * * Provides standardized error handling patterns to reduce duplication * across the qtests codebase. Centralizes error logging, context * extraction, and common error response patterns. */ export interface ErrorContext { [key: string]: any; } export interface ErrorHandlingOptions { logToConsole?: boolean; includeStack?: boolean; context?: ErrorContext; fallbackMessage?: string; } /** * Standard error handler with consistent logging and context extraction */ export declare function handleError(error: any, context: string, options?: ErrorHandlingOptions): void; /** * Async error wrapper for consistent async error handling */ export declare function handleAsyncError(promise: Promise, context: string, options?: ErrorHandlingOptions): Promise; /** * Memory error handler specifically for memory-related operations */ export declare function handleMemoryError(error: any, operation: string, additionalContext?: ErrorContext): void; /** * Validation error handler for input validation failures */ export declare function handleValidationError(error: any, validationType: string, inputData: any, additionalContext?: ErrorContext): void; /** * Security error handler for security-related events */ export declare function handleSecurityError(error: any, securityEventType: string, additionalContext?: ErrorContext): void; /** * Performance error handler for timing and performance issues */ export declare function handlePerformanceError(error: any, operation: string, duration: number, additionalContext?: ErrorContext): void; /** * Create standardized error response objects */ export declare function createErrorResponse(message: string, code?: string, statusCode?: number, additionalData?: ErrorContext): { error: string; code: string; details: ErrorContext; }; /** * Safe error message extraction */ export declare function getErrorMessage(error: any): string; /** * Safe error type extraction */ export declare function getErrorType(error: any): string; /** * Retry wrapper with exponential backoff and error handling */ export declare function retryWithBackoff(operation: () => Promise, maxRetries?: number, baseDelay?: number, context?: string): Promise; //# sourceMappingURL=errorHandling.d.ts.map