Skip to main content

rover/
error.rs

1//! Crate-wide error type.
2//!
3//! Per design supplement ยง4.4: per-module error enums via `thiserror`,
4//! `anyhow` only at the binary boundary. This `Error` enum is the
5//! library-facing top-level type that wraps domain-specific errors.
6
7use thiserror::Error;
8
9#[derive(Debug, Error)]
10pub enum Error {
11    #[error("config error: {0}")]
12    Config(#[from] crate::config::ConfigError),
13
14    #[error("fetcher error: {0}")]
15    Fetcher(#[from] crate::fetcher::FetcherError),
16
17    #[error("extractor error: {0}")]
18    Extractor(#[from] crate::extractor::ExtractorError),
19
20    #[error("storage error: {0}")]
21    Storage(#[from] crate::storage::StorageError),
22
23    #[error("tokenizer error: {0}")]
24    Tokenizer(#[from] crate::tokenizer::TokenizerError),
25
26    #[error("mcp error: {0}")]
27    Mcp(#[from] crate::mcp::McpError),
28
29    #[error("io error: {0}")]
30    Io(#[from] std::io::Error),
31}
32
33pub type Result<T> = std::result::Result<T, Error>;