Skip to main content
All errors extend VectoriaError and ship with machine-readable code values so you can branch on them.

Error Types

Importing Error Classes

Error Handling Patterns

Catch Specific Errors

Catch by Error Code

Batch Operations with Error Recovery

Graceful Degradation

Monitoring and Health

Use getStats() to feed dashboards or health endpoints:
Pair stats with toolIndex.size(), toolIndex.clear(), and toolIndex.clearStorage() to expose maintenance commands or admin tooling.

Best Practices

  1. Always catch specific errors instead of generic Error
  2. Use error codes for programmatic handling
  3. Access error properties (documentId, context, etc.) for debugging
  4. Implement retry logic for VectoriaNotInitializedError
  5. Log validation errors with context for debugging
  6. Graceful fallbacks for production resilience

Overview

Getting started

Indexing

Adding documents

Search

Querying the index