/** * Typed error code union for database-adapter-core errors. */ export type DatabaseAdapterCoreErrorCode = 'DATABASE_ERROR' | 'CONNECTION_ERROR' | 'QUERY_ERROR' | 'INVALID_INPUT' | 'OPERATION_FAILED'; /** * Options bag accepted by all database-adapter-core error classes. * * - `cause`: chained underlying error (ES2022 Error.cause). * - `code`: a typed error code from {@link DatabaseAdapterCoreErrorCode}. * - `context`: arbitrary structured context — host/port/query/params/etc. */ export interface DatabaseAdapterCoreErrorOptions { cause?: Error; code?: DatabaseAdapterCoreErrorCode; context?: Record; } /** * Base database error class. * All database-specific errors inherit from this. * * Uses native ES2022 `Error.cause` for error chaining — read the underlying * error via `error.cause` (not `.originalError`, which was removed in 2.0.0). */ export declare class DatabaseError extends Error { readonly code: DatabaseAdapterCoreErrorCode; readonly context?: Record; constructor(message: string, options?: DatabaseAdapterCoreErrorOptions); } /** * Connection-specific database error. * Thrown when connection operations fail. * * Host/port and similar details should be passed via `options.context`. */ export declare class ConnectionError extends DatabaseError { constructor(message: string, options?: Omit); } /** * Query-specific database error. * Thrown when query execution fails. * * SQL/params and similar details should be passed via `options.context`. */ export declare class QueryError extends DatabaseError { constructor(message: string, options?: Omit); } /** * Cross-package naming alias for {@link DatabaseError}. * Useful when consuming code wants to disambiguate between several * package-specific base error classes via a fully qualified name. */ export { DatabaseError as DatabaseAdapterCoreError }; //# sourceMappingURL=errors.d.ts.map