Skip to main content

mcp_compressor_core/
error.rs

1//! Crate-wide error type.
2
3/// All errors produced by the mcp-compressor-core crate.
4#[derive(Debug, thiserror::Error)]
5pub enum Error {
6    #[error("unknown compression level: {0:?}")]
7    UnknownCompressionLevel(String),
8
9    #[error("tool not found: {0:?}")]
10    ToolNotFound(String),
11
12    #[error("JSON error: {0}")]
13    Json(#[from] serde_json::Error),
14
15    #[error("IO error: {0}")]
16    Io(#[from] std::io::Error),
17
18    #[error("parse error: {0}")]
19    Parse(String),
20
21    #[error("validation error: {0}")]
22    Validation(String),
23
24    #[error("auth error: {0}")]
25    Auth(String),
26
27    #[error("config error: {0}")]
28    Config(String),
29
30    #[error("HTTP error: {0}")]
31    Http(#[from] reqwest::Error),
32
33    #[error("LLM assist error: {0}")]
34    LlmAssist(String),
35}