use thiserror::Error;
#[derive(Error, Debug)]
pub enum Error {
#[error("Agent not found: {0}")]
AgentNotFound(String),
#[error("Agent registration error: {0}")]
AgentRegistration(String),
#[error("Invalid TAP message: {0}")]
InvalidPlainMessage(String),
#[error("Agent error: {0}")]
Agent(String),
#[error("Serialization error: {0}")]
Serialization(String),
#[error("PlainMessage dispatch error: {0}")]
Dispatch(String),
#[error("PlainMessage processing error: {0}")]
Processing(String),
#[error("PlainMessage routing error: {0}")]
Routing(String),
#[error("Resolver error: {0}")]
Resolver(String),
#[error("DID resolution error: {0}")]
DidResolution(String),
#[error("Configuration error: {0}")]
Configuration(String),
#[error("Message dropped: {0}")]
MessageDropped(String),
#[error("Storage error: {0}")]
Storage(String),
#[error("Verification error: {0}")]
Verification(String),
#[error("Validation error: {0}")]
Validation(String),
}
pub type Result<T> = std::result::Result<T, Error>;
impl From<tap_agent::Error> for Error {
fn from(err: tap_agent::Error) -> Self {
Error::Agent(err.to_string())
}
}