/** * C15TError - Custom error class for typed error handling * * @example * ```typescript * import { C15TError } from '@c15t/node-sdk'; * * try { * const subject = (await client.getSubject('sub_123')).unwrap(); * } catch (error) { * if (error instanceof C15TError) { * console.log(error.status); // 404 * console.log(error.code); // 'NOT_FOUND' * console.log(error.details); * } * } * ``` */ export declare class C15TError extends Error { /** * HTTP status code of the error response */ readonly status: number; /** * Error code for programmatic error identification */ readonly code?: string; /** * Additional error details */ readonly details?: Record | null; /** * Original cause of the error (if any) */ readonly cause?: unknown; constructor(options: { message: string; status: number; code?: string; details?: Record | null; cause?: unknown; }); /** * Check if the error is a specific HTTP status code */ isStatus(status: number): boolean; /** * Check if the error is a not found error (404) */ isNotFound(): boolean; /** * Check if the error is a validation error (400) */ isValidationError(): boolean; /** * Check if the error is an authentication error (401) */ isUnauthorized(): boolean; /** * Check if the error is a forbidden error (403) */ isForbidden(): boolean; /** * Check if the error is a server error (5xx) */ isServerError(): boolean; /** * Check if the error is a network error */ isNetworkError(): boolean; /** * Convert error to a plain object for serialization */ toJSON(): { name: string; message: string; status: number; code?: string; details?: Record | null; }; } /** * Type guard to check if an error is a C15TError */ export declare function isC15TError(error: unknown): error is C15TError;