export declare abstract class ApiError extends Error { data: ErrorData; constructor(data: ErrorData, options?: ErrorOptions); } /** * Error thrown when an API response indicates that the request was not valid. */ export declare class ValidationError extends ApiError { constructor(data: ErrorData, options?: ErrorOptions); } /** * Error thrown when an API response indicates that the request was not * authorized. */ export declare class UnauthorizedError extends ApiError { constructor(data: ErrorData, options?: ErrorOptions); } /** * Error thrown when an API response indicates that the operation exceeded * the capabilities of the user's payment plan. Examples include: * * - Using features not included in the user's plan * - Exceeding the resource limits of the plan */ export declare class InadequateEntitlementsError extends ApiError { constructor(data: ErrorData, options?: ErrorOptions); } /** * Error thrown when an API response indicates that the requested resource * could not be found. */ export declare class NotFoundError extends ApiError { constructor(data: ErrorData, options?: ErrorOptions); } /** * Error thrown when an API response indicates that the request was not * allowed. */ export declare class ForbiddenError extends ApiError { constructor(data: ErrorData, options?: ErrorOptions); } /** * Error thrown when an API response indicates that the request conflicts * with server state. */ export declare class ConflictError extends ApiError { constructor(data: ErrorData, options?: ErrorOptions); } /** * Error thrown when an API response indicates a server error. */ export declare class ServerError extends ApiError { constructor(data: ErrorData, options?: ErrorOptions); } /** * Error thrown when an API response indicates an error that is not handled * globally. */ export declare class MiscellaneousError extends ApiError { constructor(data: ErrorData, options?: ErrorOptions); } /** * Error thrown when an API request times out. */ export declare class RequestTimeoutError extends ApiError { constructor(data: ErrorData, options?: ErrorOptions); } export interface ErrorData { statusCode: number; error: string; errorCode?: string; message: string; } export interface ErrorDataOptions { statusCode: number; } export declare function parseErrorData(data: any, options: ErrorDataOptions): ErrorData | undefined; /** * Error thrown when an API request unexpectedly produces no response. */ export declare class MissingResponseError extends Error { constructor(options: ErrorOptions); } export declare function handleErrorResponse(err: Error): never;