import type { ComponentInfo, ExtractionError, ExtractionWarning } from '../../types'; /** * Centralized error handling for the documentation pipeline */ export declare class ErrorHandler { private options; private errors; private warnings; private context; constructor(options?: ErrorHandlerOptions); /** * Report an error during pipeline execution */ reportError(error: PipelineError): void; /** * Report a warning during pipeline execution */ reportWarning(warning: PipelineWarning): void; /** * Convert extraction errors to pipeline errors */ handleExtractionError(extractionError: ExtractionError, component?: ComponentInfo, phase?: string): void; /** * Convert extraction warnings to pipeline warnings */ handleExtractionWarning(extractionWarning: ExtractionWarning, component?: ComponentInfo, phase?: string): void; /** * Set context for error reporting */ setContext(context: Partial): void; /** * Clear context */ clearContext(): void; /** * Execute code with temporary context */ withContext(context: Partial, fn: () => Promise): Promise; attemptRecovery(_error: PipelineError): Promise; /** * Get error summary */ getSummary(): ErrorSummary; /** * Check if pipeline can continue */ canContinue(): boolean; /** * Generate detailed error report */ generateReport(): string; private logError; private logWarning; private groupErrorsByType; private groupErrorsByComponent; private groupErrorsByPhase; /** * Reset error state (useful for watch mode) */ reset(): void; } export interface PipelineError { type: string; phase?: string; component?: string; message: string; originalError?: unknown; severity: 'error' | 'critical'; recoverable: boolean; location?: { file: string; line: number; column: number; }; timestamp?: string; context?: ErrorContext; } export interface PipelineWarning { type: string; phase?: string; component?: string; message: string; suggestion?: string; severity: 'warning' | 'info'; timestamp?: string; context?: ErrorContext; } export interface ErrorContext { packageName?: string; phase?: string; operation?: string; filePath?: string; [key: string]: unknown; } export interface ErrorHandlerOptions { failFast?: boolean; maxErrors?: number; logLevel?: 'error' | 'warn' | 'info' | 'debug'; } export interface ErrorSummary { totalErrors: number; totalWarnings: number; criticalErrors: number; recoverableErrors: number; errorsByType: Record; errorsByComponent: Record; errorsByPhase: Record; hasBlockingErrors: boolean; } /** * Custom exception for pipeline failures */ export declare class PipelineException extends Error { readonly pipelineError?: PipelineError | undefined; constructor(message: string, pipelineError?: PipelineError | undefined); } /** * Create a standard pipeline error */ export declare function createError(type: string, message: string, options?: Partial): PipelineError; /** * Create a standard pipeline warning */ export declare function createWarning(type: string, message: string, options?: Partial): PipelineWarning; /** * Wrap async operations with error handling */ export declare function withErrorHandling(operation: () => Promise, errorHandler: ErrorHandler, context?: Partial): Promise; //# sourceMappingURL=ErrorHandler.d.ts.map