rs_utcp/errors.rs
1use thiserror::Error;
2
3/// Represents errors that can occur within the UTCP client.
4#[derive(Error, Debug)]
5pub enum UtcpError {
6 /// Error when a requested tool is not found.
7 #[error("Tool not found: {0}")]
8 ToolNotFound(String),
9 /// Error related to authentication failures.
10 #[error("Authentication failed: {0}")]
11 Authentication(String),
12 /// Error occurring during a tool call execution.
13 #[error("Tool call failed: {0}")]
14 ToolCall(String),
15 /// Error related to invalid configuration.
16 #[error("Invalid configuration: {0}")]
17 Config(String),
18 /// Other errors wrapped by anyhow.
19 #[error(transparent)]
20 Other(#[from] anyhow::Error),
21}