/** * Error Utilities * * Helper functions for error handling, conversion, and type guards */ import { AuthError, ConfigError, type ErrorType, FilesystemError, NetworkError, PluginatorError, SecurityError, type SerializedError, SourceError, ValidationError, WorkflowError } from './error-types.js'; /** * Type guard for PluginatorError */ export declare function isPluginatorError(error: unknown): error is PluginatorError; /** * Type guard for NetworkError */ export declare function isNetworkError(error: unknown): error is NetworkError; /** * Type guard for ValidationError */ export declare function isValidationError(error: unknown): error is ValidationError; /** * Type guard for FilesystemError */ export declare function isFilesystemError(error: unknown): error is FilesystemError; /** * Type guard for SourceError */ export declare function isSourceError(error: unknown): error is SourceError; /** * Type guard for AuthError */ export declare function isAuthError(error: unknown): error is AuthError; /** * Type guard for ConfigError */ export declare function isConfigError(error: unknown): error is ConfigError; /** * Type guard for WorkflowError */ export declare function isWorkflowError(error: unknown): error is WorkflowError; /** * Type guard for SecurityError */ export declare function isSecurityError(error: unknown): error is SecurityError; /** * Check if an error is retryable */ export declare function isRetryableError(error: unknown): boolean; /** * Get error type discriminator */ export declare function getErrorType(error: unknown): ErrorType | 'unknown'; /** * Convert any error to a PluginatorError. Preserves the original error as `.cause` * (ES2022 standard) so the full chain is available for debugging and structured logging. * * @throws never — always returns a PluginatorError, never re-throws. */ export declare function toPluginatorError(error: unknown): PluginatorError; /** * Wrap a function call with error conversion */ export declare function withErrorHandling(fn: () => Promise, context?: Record): Promise; /** * Serialize an error for logging */ export declare function serializeError(error: unknown): SerializedError; /** * Get a user-friendly error message */ export declare function getUserErrorMessage(error: unknown): string; /** * Aggregate multiple errors into a summary */ export declare function aggregateErrors(errors: PluginatorError[]): { total: number; byType: Record; retryable: number; nonRetryable: number; }; /** * Filter errors by type */ export declare function filterErrorsByType(errors: PluginatorError[], type: ErrorType): T[]; /** * Get retryable errors only */ export declare function getRetryableErrors(errors: PluginatorError[]): PluginatorError[]; /** * Create an error from HTTP status code */ export declare function errorFromHttpStatus(status: number, url: string, message?: string): NetworkError; //# sourceMappingURL=error-utils.d.ts.map