Skip to main content

cognee_lib/
error.rs

1//! Error types for the cognee-lib crate.
2
3use thiserror::Error;
4
5/// Errors that can occur during component initialization or access.
6#[derive(Debug, Error)]
7pub enum ComponentError {
8    #[error("Storage error: {0}")]
9    Storage(String),
10
11    #[error("Database error: {0}")]
12    Database(String),
13
14    #[error("Graph database error: {0}")]
15    GraphDb(String),
16
17    #[error("Vector database error: {0}")]
18    VectorDb(String),
19
20    #[error("Embedding engine error: {0}")]
21    EmbeddingEngine(String),
22
23    #[error("LLM error: {0}")]
24    Llm(String),
25
26    #[error("Configuration error: {0}")]
27    Config(String),
28
29    #[error("IO error: {0}")]
30    Io(#[from] std::io::Error),
31}