#[derive(Debug, thiserror::Error)]
pub enum RemittanceError {
#[error("protocol error: {0}")]
Protocol(String),
#[error("invalid state transition from '{from}' to '{to}'")]
InvalidStateTransition {
from: String,
to: String,
},
#[cfg(feature = "network")]
#[error("serialization error: {0}")]
Serialization(#[from] serde_json::Error),
#[error("wallet error: {0}")]
Wallet(String),
#[error("timeout: {0}")]
Timeout(String),
#[error("module not found: {0}")]
ModuleNotFound(String),
#[error("duplicate message: {0}")]
DuplicateMessage(String),
#[error("auth error: {0}")]
Auth(String),
}
impl From<crate::wallet::error::WalletError> for RemittanceError {
fn from(e: crate::wallet::error::WalletError) -> Self {
RemittanceError::Wallet(e.to_string())
}
}
impl From<crate::auth::AuthError> for RemittanceError {
fn from(e: crate::auth::AuthError) -> Self {
RemittanceError::Auth(e.to_string())
}
}