use thiserror::Error;
#[cfg(not(target_arch = "wasm32"))]
use tokio::task::JoinError as TaskJoinError;
#[cfg(target_arch = "wasm32")]
use tokio_with_wasm::task::JoinError as TaskJoinError;
#[derive(Debug, Error)]
pub enum ArbiterError {
#[error("channel closed unexpectedly")]
ChannelClosed,
#[error("spawned task panicked")]
TaskPanicked(#[from] TaskJoinError),
#[error("snapshot stream already taken")]
StreamAlreadyTaken,
}
pub type Result<T> = std::result::Result<T, ArbiterError>;