/** * @fileoverview Error types for the Meteo.lt SDK. * @module meteo-lt-sdk/types/errors */ /** * Base error class for all Meteo.lt API errors. * Contains the HTTP status code and response body for debugging. */ export declare class MeteoApiError extends Error { readonly statusCode: number; readonly responseBody?: string | undefined; /** Error name for instanceof checks */ readonly name: string; /** * Creates a new MeteoApiError. * @param message - Human-readable error message * @param statusCode - HTTP status code from the API response * @param responseBody - Raw response body for debugging */ constructor(message: string, statusCode: number, responseBody?: string | undefined); } /** * Error thrown when a requested resource is not found (HTTP 404). * This can occur when: * - A place code doesn't exist * - A station code doesn't exist * - No observations exist for the requested date */ export declare class MeteoNotFoundError extends MeteoApiError { readonly resource: string; readonly name: string; /** * Creates a new MeteoNotFoundError. * @param resource - Description of the resource that wasn't found * @param responseBody - Raw response body for debugging */ constructor(resource: string, responseBody?: string); } /** * Error thrown when the rate limit is exceeded (HTTP 429). * The API limits requests to 180 per minute per IP address. */ export declare class MeteoRateLimitError extends MeteoApiError { readonly retryAfterSeconds?: number | undefined; readonly name: string; /** * Creates a new MeteoRateLimitError. * @param retryAfterSeconds - Seconds to wait before retrying (if provided by API) * @param responseBody - Raw response body for debugging */ constructor(retryAfterSeconds?: number | undefined, responseBody?: string); } /** * Error thrown when response validation fails. * This indicates the API returned data that doesn't match the expected schema. */ export declare class MeteoValidationError extends MeteoApiError { readonly validationErrors: readonly string[]; readonly name: string; /** * Creates a new MeteoValidationError. * @param message - Description of what validation failed * @param validationErrors - Detailed validation error information * @param responseBody - Raw response body for debugging */ constructor(message: string, validationErrors: readonly string[], responseBody?: string); } /** * Error thrown when a network request fails. * This wraps fetch errors for consistent error handling. */ export declare class MeteoNetworkError extends MeteoApiError { readonly cause?: Error | undefined; readonly name: string; /** * Creates a new MeteoNetworkError. * @param message - Description of the network error * @param cause - Original error that caused this error */ constructor(message: string, cause?: Error | undefined); } /** * Error thrown when a request times out. */ export declare class MeteoTimeoutError extends MeteoApiError { readonly timeoutMs: number; readonly name: string; /** * Creates a new MeteoTimeoutError. * @param timeoutMs - The timeout value in milliseconds */ constructor(timeoutMs: number); } //# sourceMappingURL=errors.d.ts.map