Skip to main content

brainos_mcphost/
error.rs

1//! MCP host error taxonomy.
2
3use thiserror::Error;
4
5#[derive(Debug, Error)]
6pub enum McpHostError {
7    #[error("server '{0}' is already mounted")]
8    AlreadyMounted(String),
9
10    #[error("server '{0}' not mounted")]
11    NotMounted(String),
12
13    #[error("initialize failed: {0}")]
14    Initialize(String),
15
16    #[error("protocol version negotiation failed: got {0}")]
17    Version(String),
18
19    #[error("tool '{0}' not found on server '{1}'")]
20    NoTool(String, String),
21
22    #[error("transport error: {0}")]
23    Transport(String),
24
25    #[error("auth error: {0}")]
26    Auth(String),
27
28    #[error("rmcp error: {0}")]
29    Rmcp(String),
30
31    #[error("identity gate denied: {0}")]
32    Denied(String),
33}