/** * Custom error classes for type-safe error handling * Copyright (c) 2026 Mihajlo Stojanovski */ /** * Base error class for all reporter errors */ export declare class ReporterError extends Error { readonly code: string; readonly context?: Record | undefined; constructor(message: string, code: string, context?: Record | undefined); /** * Convert error to JSON for logging */ toJSON(): Record; } /** * Configuration validation error */ export declare class ConfigurationError extends ReporterError { constructor(message: string, context?: Record); } /** * File system operation error */ export declare class FileSystemError extends ReporterError { readonly operation: "read" | "write" | "delete" | "access"; readonly filePath: string; constructor(message: string, operation: "read" | "write" | "delete" | "access", filePath: string, cause?: Error); } /** * Platform compatibility error */ export declare class PlatformError extends ReporterError { readonly platform: string; readonly feature: string; constructor(message: string, platform: string, feature: string); } /** * OpenAI API error */ export declare class OpenAIError extends ReporterError { readonly statusCode?: number | undefined; readonly apiMessage?: string | undefined; constructor(message: string, statusCode?: number | undefined, apiMessage?: string | undefined); } /** * Rate limit exceeded error */ export declare class RateLimitError extends ReporterError { readonly retryAfter?: number | undefined; constructor(message: string, retryAfter?: number | undefined); } /** * Circuit breaker open error */ export declare class CircuitBreakerError extends ReporterError { readonly resetTime: Date; constructor(message: string, resetTime: Date); } /** * Telemetry collection error */ export declare class TelemetryError extends ReporterError { readonly platform: string; constructor(message: string, platform: string, cause?: Error); } /** * Memory error (out of memory, etc.) */ export declare class MemoryError extends ReporterError { readonly usedBytes: number; readonly totalBytes: number; constructor(message: string, usedBytes: number, totalBytes: number); } /** * Input validation error */ export declare class ValidationError extends ReporterError { readonly field: string; readonly value: unknown; constructor(message: string, field: string, value: unknown); } /** * Test execution error */ export declare class TestExecutionError extends ReporterError { readonly testId: string; constructor(message: string, testId: string, cause?: Error); } /** * Type guard to check if error is a ReporterError */ export declare function isReporterError(error: unknown): error is ReporterError; /** * Type guard to check if error is a standard Error */ export declare function isError(error: unknown): error is Error; /** * Safe error message extraction */ export declare function getErrorMessage(error: unknown): string; /** * Safe error code extraction */ export declare function getErrorCode(error: unknown): string; /** * Format error for logging */ export declare function formatError(error: unknown): string; //# sourceMappingURL=errors.d.ts.map