/** * NodeLLM Error Hierarchy * * **Stability Contract**: These error types and their semantics are part of the * public API and will not change without a major version bump. * * - Error names are stable * - Error codes are stable * - Error semantics (when they're thrown) are stable * - New errors may be added (non-breaking) * - Existing error meanings will not change * * @see ARCHITECTURE.md for error contract details */ /** * Base class for all NodeLLM errors */ export declare class LLMError extends Error { readonly code?: string | undefined; constructor(message: string, code?: string | undefined); } /** * Errors occurring during API calls to providers */ export declare class APIError extends LLMError { readonly status: number; readonly body: unknown; readonly provider?: string | undefined; readonly model?: string | undefined; constructor(message: string, status: number, body: unknown, provider?: string | undefined, model?: string | undefined); } /** * 400 - Invalid request parameters */ export declare class BadRequestError extends APIError { constructor(message: string, body: unknown, provider?: string, model?: string); } /** * 400 - Specifically for context window/token limit issues */ export declare class ContextWindowExceededError extends BadRequestError { constructor(message: string, body: unknown, provider?: string, model?: string); } /** * 401 - Invalid or missing API key */ export declare class UnauthorizedError extends APIError { constructor(message: string, body: unknown, provider?: string); } /** * 402 - Payment required (billing issues) */ export declare class PaymentRequiredError extends APIError { constructor(message: string, body: unknown, provider?: string); } /** * 403 - Permission denied */ export declare class ForbiddenError extends APIError { constructor(message: string, body: unknown, provider?: string); } /** * 401/403 - API key or permission issues * @deprecated Use UnauthorizedError (401) or ForbiddenError (403) for granular handling */ export declare class AuthenticationError extends APIError { constructor(message: string, status: number, body: unknown, provider?: string); } /** * 429 - Rate limit exceeded */ export declare class RateLimitError extends APIError { constructor(message: string, body: unknown, provider?: string, model?: string); } /** * 429 - Out of credits or monthly quota exceeded */ export declare class InsufficientQuotaError extends RateLimitError { constructor(message: string, body: unknown, provider?: string, model?: string); } /** * 500+ - Provider server error */ export declare class ServerError extends APIError { constructor(message: string, status: number, body: unknown, provider?: string, model?: string); } /** * 502/503/529 - Service overloaded/unavailable */ export declare class ServiceUnavailableError extends ServerError { constructor(message: string, status: number, body: unknown, provider?: string, model?: string); } /** * Misconfiguration (e.g. missing API key) */ export declare class ConfigurationError extends LLMError { constructor(message: string); } /** * Requested model or provider not found */ export declare class NotFoundError extends APIError { constructor(message: string, status?: number, body?: unknown, provider?: string, model?: string); } /** * Specifically when the requested model ID is invalid/unknown */ export declare class InvalidModelError extends NotFoundError { constructor(message: string, body: unknown, provider?: string, model?: string); } /** * Model does not support requested capability */ export declare class CapabilityError extends LLMError { constructor(message: string); } /** * Thrown when LLM provider is not configured */ export declare class ProviderNotConfiguredError extends LLMError { constructor(); } /** * Thrown when a provider doesn't support a requested feature */ export declare class UnsupportedFeatureError extends LLMError { readonly provider: string; readonly feature: string; constructor(provider: string, feature: string); } /** * Thrown when a model doesn't support a requested capability */ export declare class ModelCapabilityError extends LLMError { readonly model: string; readonly capability: string; constructor(model: string, capability: string); } /** * Thrown when a tool execution fails */ export declare class ToolError extends LLMError { readonly toolName?: string | undefined; readonly fatal: boolean; constructor(message: string, toolName?: string | undefined, fatal?: boolean); } //# sourceMappingURL=index.d.ts.map