1use thiserror::Error;
4
5#[derive(Error, Debug)]
7pub enum Error {
8 #[error("Agent not found: {0}")]
10 AgentNotFound(String),
11
12 #[error("Agent registration error: {0}")]
14 AgentRegistration(String),
15
16 #[error("Invalid TAP message: {0}")]
18 InvalidMessage(String),
19
20 #[error("Agent error: {0}")]
22 Agent(String),
23
24 #[error("Serialization error: {0}")]
26 Serialization(serde_json::Error),
27
28 #[error("Message dispatch error: {0}")]
30 Dispatch(String),
31
32 #[error("Message processing error: {0}")]
34 Processing(String),
35
36 #[error("Message routing error: {0}")]
38 Routing(String),
39
40 #[error("Resolver error: {0}")]
42 Resolver(String),
43
44 #[error("DID resolution error: {0}")]
46 DidResolution(String),
47
48 #[error("Configuration error: {0}")]
50 Configuration(String),
51}
52
53pub type Result<T> = std::result::Result<T, Error>;
55
56impl From<tap_agent::Error> for Error {
58 fn from(err: tap_agent::Error) -> Self {
59 Error::Agent(err.to_string())
60 }
61}