import { ErrorCode } from '../server/types.js'; /** * Comprehensive Error Handling System for UniFi MCP Server * * Provides structured error handling, categorization, and recovery * mechanisms for all UniFi API interactions and server operations. */ export declare class UniFiMCPError extends Error { readonly code: ErrorCode; readonly statusCode?: number | undefined; readonly details?: any | undefined; readonly retryable: boolean; readonly timestamp: Date; readonly context?: Record; constructor(message: string, code: ErrorCode, statusCode?: number | undefined, details?: any | undefined, retryable?: boolean, context?: Record); toJSON(): object; toString(): string; } export declare class ConnectionError extends UniFiMCPError { constructor(message: string, details?: any, retryable?: boolean); } export declare class AuthenticationError extends UniFiMCPError { constructor(message?: string, details?: any); } export declare class APIKeyError extends UniFiMCPError { constructor(message?: string, details?: any); } export declare class NetworkTimeoutError extends UniFiMCPError { constructor(message: string | undefined, timeout: number, details?: any); } export declare class RateLimitError extends UniFiMCPError { constructor(message?: string, retryAfter?: number, details?: any); } export declare class FeatureNotSupportedError extends UniFiMCPError { constructor(feature: string, requiredVersion?: string, currentVersion?: string); } export declare class HardwareIncompatibleError extends UniFiMCPError { constructor(feature: string, hardwareModel: string, supportedModels?: string[]); } export declare class ValidationError extends UniFiMCPError { constructor(message: string, field?: string, value?: any, constraints?: string[]); } export declare class ResourceNotFoundError extends UniFiMCPError { constructor(resourceType: string, identifier: string, details?: any); } export declare class ResourceConflictError extends UniFiMCPError { constructor(message: string, conflictingResource?: string, details?: any); } export declare class ConfigurationError extends UniFiMCPError { constructor(message: string, configField?: string, details?: any); } export declare class ErrorFactory { static fromHttpError(error: any, context?: Record): UniFiMCPError; static fromNetworkError(error: any, _context?: Record): UniFiMCPError; static fromValidationError(zodError: any, _context?: Record): ValidationError; } export interface RetryConfig { maxAttempts: number; baseDelay: number; maxDelay: number; exponentialBackoff: boolean; retryCondition?: (error: Error) => boolean; } export declare class ErrorRecovery { static defaultRetryConfig: RetryConfig; static withRetry(operation: () => Promise, config?: Partial): Promise; static withCircuitBreaker(operation: () => Promise, _circuitBreakerConfig?: { failureThreshold?: number; resetTimeout?: number; monitoringWindow?: number; }): Promise; } export interface ErrorHandler { canHandle(error: Error): boolean; handle(error: Error, context?: Record): Promise; } export declare class ConnectionErrorHandler implements ErrorHandler { canHandle(error: Error): boolean; handle(error: Error, context?: Record): Promise; } export declare class AuthenticationErrorHandler implements ErrorHandler { canHandle(error: Error): boolean; handle(error: Error, context?: Record): Promise; } export declare class FeatureErrorHandler implements ErrorHandler { canHandle(error: Error): boolean; handle(error: Error, context?: Record): Promise; } export declare class ErrorManager { private handlers; addHandler(handler: ErrorHandler): void; handleError(error: Error, context?: Record): Promise; createErrorResponse(error: Error): { success: false; error: { code: string; message: string; details?: any; }; }; } export { ErrorCode } from '../server/types.js'; export declare const errorManager: ErrorManager; //# sourceMappingURL=errors.d.ts.map