use thiserror::Error;
pub type RtcResult<T> = Result<T, EnigmaRtcError>;
#[derive(Debug, Error)]
pub enum EnigmaRtcError {
#[error("invalid call state for this operation")]
InvalidState,
#[error("invalid session description")]
InvalidSdp,
#[error("invalid ice candidate")]
InvalidCandidate,
#[error("webrtc error: {0}")]
WebRtcError(String),
#[error("json error: {0}")]
JsonError(String),
#[error("event channel closed")]
ChannelClosed,
}