use thiserror::Error;
#[derive(Debug, Error, Clone)]
pub enum MediaTransportError {
#[error("Configuration error: {0}")]
ConfigError(String),
#[error("Transport error: {0}")]
Transport(String),
#[error("Security error: {0}")]
Security(String),
#[error("Initialization error: {0}")]
InitializationError(String),
#[error("Connection error: {0}")]
ConnectionError(String),
#[error("Authentication error: {0}")]
AuthenticationError(String),
#[error("Send error: {0}")]
SendError(String),
#[error("Receive error: {0}")]
ReceiveError(String),
#[error("Transport not connected")]
NotConnected,
#[error("Configuration error: {0}")]
Configuration(String),
#[error("Timeout error: {0}")]
Timeout(String),
#[error("RTCP error: {0}")]
RtcpError(String),
#[error("No clients connected")]
NoClients,
#[error("Client not found: {0}")]
ClientNotFound(String),
#[error("Client not connected: {0}")]
ClientNotConnected(String),
#[error("Buffer is full: {0}")]
BufferFull(String),
#[error("Buffer error: {0}")]
BufferError(String),
#[error("Invalid input: {0}")]
InvalidInput(String),
}
#[derive(Debug, thiserror::Error)]
pub enum SecurityError {
#[error("Security configuration error: {0}")]
Configuration(String),
#[error("DTLS handshake error: {0}")]
Handshake(String),
#[error("Handshake verification error: {0}")]
HandshakeVerification(String),
#[error("Handshake error: {0}")]
HandshakeError(String),
#[error("Security not initialized: {0}")]
NotInitialized(String),
#[error("Invalid security state: {0}")]
InvalidState(String),
#[error("Cryptographic error: {0}")]
CryptoError(String),
#[error("Internal security error: {0}")]
Internal(String),
#[error("Security timeout: {0}")]
Timeout(String),
#[error("Network error: {0}")]
Network(String),
#[error("Authentication failed: {0}")]
Authentication(String),
#[error("Not found: {0}")]
NotFound(String),
#[error("Security policy violation: {0}")]
PolicyViolation(String),
}
#[derive(Error, Debug)]
pub enum BufferError {
#[error("Buffer is full")]
BufferFull,
#[error("Buffer is empty")]
BufferEmpty,
#[error("Configuration error: {0}")]
ConfigurationError(String),
#[error("Buffer operation error: {0}")]
OperationError(String),
}
#[derive(Error, Debug)]
pub enum StatsError {
#[error("No statistics available")]
NoStatsAvailable,
#[error("Invalid stream identifier: {0}")]
InvalidStreamId(String),
#[error("Statistics error: {0}")]
Other(String),
}