use thiserror::Error;
#[derive(Debug, Error)]
pub enum AuthError {
#[error("session not found: {0}")]
SessionNotFound(String),
#[error("not authenticated: {0}")]
NotAuthenticated(String),
#[error("authentication failed: {0}")]
AuthFailed(String),
#[error("invalid message: {0}")]
InvalidMessage(String),
#[error("invalid signature: {0}")]
InvalidSignature(String),
#[error("timeout: {0}")]
Timeout(String),
#[error("transport not connected: {0}")]
TransportNotConnected(String),
#[error("invalid nonce: {0}")]
InvalidNonce(String),
#[error("missing certificate: {0}")]
MissingCertificate(String),
#[error("certificate validation error: {0}")]
CertificateValidation(String),
#[error("transport error: {0}")]
TransportError(String),
#[error("serialization error: {0}")]
SerializationError(String),
#[error("wallet error: {0}")]
Wallet(#[from] crate::wallet::WalletError),
#[error("primitives error: {0}")]
Primitives(#[from] crate::primitives::PrimitivesError),
#[error("payment flow error: {0}")]
Payment(String),
#[error("paid request failed after {attempts}/{max_attempts} attempts: {message}")]
PaymentFailed {
attempts: u32,
max_attempts: u32,
message: String,
},
}