Skip to main content

zeph_memory/document/
error.rs

1// SPDX-FileCopyrightText: 2026 Andrei G <bug-ops>
2// SPDX-License-Identifier: MIT OR Apache-2.0
3
4#[derive(Debug, thiserror::Error)]
5pub enum DocumentError {
6    #[error("IO error: {0}")]
7    Io(#[from] std::io::Error),
8
9    #[error("unsupported format: {0}")]
10    UnsupportedFormat(String),
11
12    #[error("file too large: {0} bytes")]
13    FileTooLarge(u64),
14
15    #[cfg(feature = "pdf")]
16    #[error("PDF error: {0}")]
17    Pdf(String),
18
19    #[error("embedding failed: {0}")]
20    Embedding(#[from] zeph_llm::LlmError),
21
22    #[error("storage error: {0}")]
23    Storage(#[from] crate::error::MemoryError),
24}