use crate::auth::IdentityFingerprint;
use thiserror::Error;
#[derive(Debug, Error)]
pub enum RelayError {
#[error("WebSocket error: {0}")]
WebSocket(String),
#[error("Authentication failed: {0}")]
AuthenticationFailed(String),
#[error("Destination not found: {0:?}")]
DestinationNotFound(IdentityFingerprint),
#[error("Message serialization error: {0}")]
Serialization(#[from] serde_json::Error),
#[error("Connection closed")]
ConnectionClosed,
#[error("Invalid message: {0}")]
InvalidMessage(String),
#[error("IO error: {0}")]
Io(#[from] std::io::Error),
#[error("Not connected")]
NotConnected,
#[error("Already connected")]
AlreadyConnected,
#[error("Authentication timeout")]
AuthenticationTimeout,
#[error("Channel send failed")]
ChannelSendFailed,
}