/** * Base error interface for all 23blocks SDK errors */ export interface BlockError { /** Error code identifier */ code: string; /** Human-readable error message */ message: string; /** HTTP status code */ status: number; /** Source pointer (e.g., '/data/attributes/email') */ source?: string; /** Additional metadata */ meta?: Record; /** Unique request ID for tracing and support */ requestId?: string; /** Request duration in milliseconds */ duration?: number; } /** * BlockError class that can be thrown and caught */ export declare class BlockErrorException extends Error implements BlockError { readonly code: string; readonly status: number; readonly source?: string; readonly meta?: Record; readonly requestId?: string; readonly duration?: number; constructor(error: BlockError); toJSON(): BlockError; } /** * Type guard to check if an error is a BlockError */ export declare function isBlockError(error: unknown): error is BlockError; /** * Type guard to check if an error is a BlockErrorException */ export declare function isBlockErrorException(error: unknown): error is BlockErrorException; /** * Common error codes used across the SDK */ export declare const ErrorCodes: { readonly UNAUTHORIZED: "unauthorized"; readonly FORBIDDEN: "forbidden"; readonly INVALID_CREDENTIALS: "invalid_credentials"; readonly TOKEN_EXPIRED: "token_expired"; readonly TOKEN_INVALID: "token_invalid"; readonly VALIDATION_ERROR: "validation_error"; readonly INVALID_ATTRIBUTE: "invalid_attribute"; readonly MISSING_ATTRIBUTE: "missing_attribute"; readonly NOT_FOUND: "not_found"; readonly CONFLICT: "conflict"; readonly ALREADY_EXISTS: "already_exists"; readonly INTERNAL_ERROR: "internal_error"; readonly SERVICE_UNAVAILABLE: "service_unavailable"; readonly TIMEOUT: "timeout"; readonly NETWORK_ERROR: "network_error"; readonly CONNECTION_REFUSED: "connection_refused"; }; export type ErrorCode = (typeof ErrorCodes)[keyof typeof ErrorCodes]; //# sourceMappingURL=errors.d.ts.map