VectoriaError and ship with machine-readable code values so you can branch on them.
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 Error Classes
Error Handling Patterns
Catch Specific Errors
Catch by Error Code
Batch Operations with Error Recovery
Graceful Degradation
Monitoring and Health
UsegetStats() to feed dashboards or health endpoints:
toolIndex.size(), toolIndex.clear(), and toolIndex.clearStorage() to expose maintenance commands or admin tooling.
Best Practices
- Always catch specific errors instead of generic
Error - Use error codes for programmatic handling
- Access error properties (
documentId,context, etc.) for debugging - Implement retry logic for
VectoriaNotInitializedError - Log validation errors with context for debugging
- Graceful fallbacks for production resilience
Related
Overview
Getting started
Indexing
Adding documents
Search
Querying the index