UNPKG

@gensx/storage

Version:

Cloud storage, blobs, sqlite, and vector database providers/hooks for GenSX.

95 lines (91 loc) 2.61 kB
'use strict'; /** * Check out the docs at https://www.gensx.com/docs * Find us on Github https://github.com/gensx-inc/gensx * Find us on Discord https://discord.gg/F5BSU8Kc */ /** * Abstract base error class for database operations */ class DatabaseError extends Error { code; cause; constructor(code, message, cause) { super(message); this.code = code; this.cause = cause; this.name = "DatabaseError"; } } /** * Error class for when a database is not found */ class DatabaseNotFoundError extends DatabaseError { constructor(message, cause) { super("NOT_FOUND", message, cause); this.name = "DatabaseNotFoundError"; } } /** * Error class for permission denied errors */ class DatabasePermissionDeniedError extends DatabaseError { constructor(message, cause) { super("PERMISSION_DENIED", message, cause); this.name = "DatabasePermissionDeniedError"; } } /** * Error class for SQL syntax errors */ class DatabaseSyntaxError extends DatabaseError { constructor(message, cause) { super("SYNTAX_ERROR", message, cause); this.name = "DatabaseSyntaxError"; } } /** * Error class for constraint violations */ class DatabaseConstraintError extends DatabaseError { constructor(message, cause) { super("CONSTRAINT_VIOLATION", message, cause); this.name = "DatabaseConstraintError"; } } /** * Error class for internal errors */ class DatabaseInternalError extends DatabaseError { constructor(message, cause) { super("INTERNAL_ERROR", message, cause); this.name = "DatabaseInternalError"; } } /** * Error class for network errors */ class DatabaseNetworkError extends DatabaseError { constructor(message, cause) { super("NETWORK_ERROR", message, cause); this.name = "DatabaseNetworkError"; } } /** * Error class for transaction errors */ class DatabaseTransactionError extends DatabaseError { constructor(message, cause) { super("TRANSACTION_ERROR", message, cause); this.name = "DatabaseTransactionError"; } } exports.DatabaseConstraintError = DatabaseConstraintError; exports.DatabaseError = DatabaseError; exports.DatabaseInternalError = DatabaseInternalError; exports.DatabaseNetworkError = DatabaseNetworkError; exports.DatabaseNotFoundError = DatabaseNotFoundError; exports.DatabasePermissionDeniedError = DatabasePermissionDeniedError; exports.DatabaseSyntaxError = DatabaseSyntaxError; exports.DatabaseTransactionError = DatabaseTransactionError; //# sourceMappingURL=types.cjs.map