Documentation Index
Fetch the complete documentation index at: https://docs.agentfront.dev/llms.txt
Use this file to discover all available pages before exploring further.
All VectoriaDB errors extend VectoriaError and include machine-readable code values.
Error Types
| Error | Code | Description |
|---|
VectoriaNotInitializedError | NOT_INITIALIZED | Call initialize() first |
DocumentValidationError | DOCUMENT_VALIDATION_ERROR | Invalid document data |
DocumentNotFoundError | DOCUMENT_NOT_FOUND | Document ID doesn’t exist |
DocumentExistsError | DOCUMENT_EXISTS | Document ID already exists |
DuplicateDocumentError | DUPLICATE_DOCUMENT | Duplicate in batch |
QueryValidationError | QUERY_VALIDATION_ERROR | Invalid search query |
EmbeddingError | EMBEDDING_ERROR | Model embedding failed |
StorageError | STORAGE_ERROR | Storage operation failed |
ConfigurationError | CONFIGURATION_ERROR | Invalid config |
Importing Errors
import {
VectoriaError,
VectoriaNotInitializedError,
DocumentValidationError,
DocumentNotFoundError,
DocumentExistsError,
DuplicateDocumentError,
QueryValidationError,
EmbeddingError,
StorageError,
ConfigurationError,
} from 'vectoriadb';
VectoriaError
Base class for all VectoriaDB errors.
class VectoriaError extends Error {
readonly code: string;
constructor(message: string, code: string);
}
VectoriaNotInitializedError
Thrown when operations are attempted before initialization.
class VectoriaNotInitializedError extends VectoriaError {
constructor(operation: string);
}
Example
try {
await db.add('id', 'text', metadata);
} catch (error) {
if (error instanceof VectoriaNotInitializedError) {
await db.initialize();
await db.add('id', 'text', metadata);
}
}
DocumentValidationError
Thrown when document validation fails.
class DocumentValidationError extends VectoriaError {
readonly documentId?: string;
constructor(message: string, documentId?: string);
}
DocumentNotFoundError
Thrown when a document ID doesn’t exist.
class DocumentNotFoundError extends VectoriaError {
readonly documentId: string;
constructor(documentId: string);
}
DocumentExistsError
Thrown when adding a document with an existing ID.
class DocumentExistsError extends VectoriaError {
readonly documentId: string;
constructor(documentId: string);
}
DuplicateDocumentError
Thrown when duplicates are found in batch operations.
class DuplicateDocumentError extends VectoriaError {
readonly documentId: string;
readonly context: 'batch' | 'existing';
constructor(documentId: string, context: 'batch' | 'existing');
}
QueryValidationError
Thrown when search parameters are invalid.
class QueryValidationError extends VectoriaError {
constructor(message: string);
}
EmbeddingError
Thrown when embedding generation fails.
class EmbeddingError extends VectoriaError {
readonly details?: any;
constructor(message: string, details?: any);
}
StorageError
Thrown when storage operations fail.
class StorageError extends VectoriaError {
readonly originalError?: Error;
constructor(message: string, originalError?: Error);
}
ConfigurationError
Thrown when configuration is invalid.
class ConfigurationError extends VectoriaError {
constructor(message: string);
}
Error Handling Pattern
try {
await db.addMany(documents);
} catch (error) {
if (error instanceof VectoriaNotInitializedError) {
await db.initialize();
return; // Retry
}
if (error instanceof DocumentValidationError) {
console.warn(`Invalid document: ${error.documentId}`);
return;
}
if (error instanceof VectoriaError) {
console.error(`VectoriaDB error [${error.code}]:`, error.message);
return;
}
throw error; // Re-throw unexpected errors
}
Common Errors
Error solutions
FAQ
Frequently asked questions