/** * Standardized error information */ export interface ErrorInfo { statusCode: number; statusMessage?: string; message: string; } /** * Extracts HTTP status code from OpenAI SDK errors. * OpenAI APIError (and subclasses) expose a `status` property. */ /** * Extract HTTP status code from an error, if available. * OpenAI APIError has a `status` property. Connection/timeout errors may have undefined status. * @returns The status code (e.g. 400, 401, 429, 500) or undefined if not available */ export declare function extractStatusFromError(error: unknown): number | undefined; /** * Manages error mapping and retry logic for various error types */ export declare class ErrorManager { /** * Map an error to standardized format * @param error The error to map * @returns Standardized error information */ mapError(error: unknown): ErrorInfo; /** * Check if an error is retryable based on status code * @param error The error to check * @returns True if the error is retryable */ isRetryable(error: unknown): boolean; } /** * Base exception class for all API errors. * Attempts to parse error messages from API responses, extracting the "detail" field * if the response is JSON, otherwise uses the message as-is. * */ export declare class APIException extends Error { readonly message: string; readonly originalMessage?: string; constructor(message: string | unknown); } /** * Exception raised when dataset operations fail. */ export declare class DatasetAPIException extends APIException { constructor(message: string | unknown); } /** * Exception raised when project operations fail. */ export declare class ProjectAPIException extends APIException { constructor(message: string | unknown); }