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)]
5#[non_exhaustive]
6pub enum DocumentError {
7    #[error("IO error: {0}")]
8    Io(#[from] std::io::Error),
9
10    #[error("unsupported format: {0}")]
11    UnsupportedFormat(String),
12
13    #[error("file too large: {0} bytes")]
14    FileTooLarge(u64),
15
16    #[cfg(feature = "pdf")]
17    #[error("PDF error: {0}")]
18    Pdf(String),
19
20    #[error("embedding failed: {0}")]
21    Embedding(#[from] zeph_llm::LlmError),
22
23    #[error("storage error: {0}")]
24    Storage(#[from] crate::error::MemoryError),
25}