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 InvalidPlainMessage(String),
19
20 #[error("Agent error: {0}")]
22 Agent(String),
23
24 #[error("Serialization error: {0}")]
26 Serialization(String),
27
28 #[error("PlainMessage dispatch error: {0}")]
30 Dispatch(String),
31
32 #[error("PlainMessage processing error: {0}")]
34 Processing(String),
35
36 #[error("PlainMessage 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 #[error("Message dropped: {0}")]
54 MessageDropped(String),
55
56 #[error("Storage error: {0}")]
58 Storage(String),
59
60 #[error("Verification error: {0}")]
62 Verification(String),
63
64 #[error("Validation error: {0}")]
66 Validation(String),
67}
68
69pub type Result<T> = std::result::Result<T, Error>;
71
72impl From<tap_agent::Error> for Error {
74 fn from(err: tap_agent::Error) -> Self {
75 Error::Agent(err.to_string())
76 }
77}