/** * HTTP客户端基础错误类 */ export declare class HttpClientError extends Error { readonly code: string; readonly statusCode?: number; readonly response?: any; readonly config?: any; constructor(message: string, code?: string, statusCode?: number, response?: any, config?: any); } /** * 网络错误 */ export declare class NetworkError extends HttpClientError { constructor(message: string, config?: any); } /** * 超时错误 */ export declare class TimeoutError extends HttpClientError { constructor(message: string, config?: any); } /** * 重试失败错误 */ export declare class RetryExhaustedError extends HttpClientError { readonly attempts: number; readonly lastError: any; constructor(message: string, attempts: number, lastError: any, config?: any); } /** * 熔断器开启错误 */ export declare class CircuitBreakerOpenError extends HttpClientError { readonly circuitName: string; readonly failureCount: number; constructor(message: string, circuitName: string, failureCount: number, config?: any); } /** * API认证错误 */ export declare class AuthenticationError extends HttpClientError { constructor(message: string, statusCode?: number, response?: any, config?: any); } /** * API授权错误 */ export declare class AuthorizationError extends HttpClientError { constructor(message: string, statusCode?: number, response?: any, config?: any); } /** * 限流错误 */ export declare class RateLimitError extends HttpClientError { readonly retryAfter?: number; readonly limit?: number; readonly remaining?: number; constructor(message: string, statusCode?: number, response?: any, config?: any, retryAfter?: number, limit?: number, remaining?: number); } /** * 服务器错误 */ export declare class ServerError extends HttpClientError { constructor(message: string, statusCode?: number, response?: any, config?: any); } /** * 响应格式错误 */ export declare class ResponseFormatError extends HttpClientError { readonly responseData: any; constructor(message: string, responseData: any, config?: any); } /** * API客户端配置错误 */ export declare class ApiClientConfigError extends HttpClientError { constructor(message: string, config?: any); } /** * 缓存错误 */ export declare class CacheError extends HttpClientError { constructor(message: string, config?: any); } /** * 错误工厂函数 */ export declare class ErrorFactory { /** * 根据axios错误创建对应的HTTP客户端错误 */ static fromAxiosError(error: any): HttpClientError; /** * 创建重试失败错误 */ static createRetryExhaustedError(attempts: number, lastError: any, config?: any): RetryExhaustedError; /** * 创建熔断器开启错误 */ static createCircuitBreakerOpenError(circuitName: string, failureCount: number, config?: any): CircuitBreakerOpenError; /** * 创建响应格式错误 */ static createResponseFormatError(message: string, responseData: any, config?: any): ResponseFormatError; /** * 创建API客户端配置错误 */ static createApiClientConfigError(message: string, config?: any): ApiClientConfigError; /** * 创建缓存错误 */ static createCacheError(message: string, config?: any): CacheError; }