use thiserror::Error;
#[derive(Error, Debug)]
pub enum Error {
#[error("Failed to parse configuration: {0}")]
ConfigParse(String),
#[error("Invalid configuration: {0}")]
ConfigInvalid(String),
#[error("Server process error: {0}")]
Process(String),
#[error("JSON-RPC error: {0}")]
JsonRpc(String),
#[error("Transport error: {0}")]
Transport(String),
#[error("Server not found: {0}")]
ServerNotFound(String),
#[error("Tool not found: {0}")]
ToolNotFound(String),
#[error("Resource not found: {0}")]
ResourceNotFound(String),
#[error("Communication error: {0}")]
Communication(String),
#[error("Timeout: {0}")]
Timeout(String),
#[error("Already running")]
AlreadyRunning,
#[error("Not running")]
NotRunning,
#[error("Serialization error: {0}")]
Serialization(String),
#[error("Config validation error: {0}")]
ConfigValidation(String),
#[error("Unauthorized: {0}")]
Unauthorized(String),
#[error("Client already cached")]
ClientAlreadyCached,
#[error("Other error: {0}")]
Other(String),
}
pub type Result<T> = std::result::Result<T, Error>;