use std::net::AddrParseError;
#[derive(Clone, Debug, thiserror::Error)]
pub enum NetmodError {
#[error("the requested operation is not supported by the netmod")]
NotSupported,
#[error("frame is too large to send through this channel")]
FrameTooLarge,
#[error("peering connection was suddenly lost mid-transfer")]
ConnectionLost,
#[error("the provided peer '{}' was invalid!", 0)]
InvalidPeer(String),
#[error("failed to setup netmod bind: {}", 0)]
InvalidBind(String),
}
impl From<AddrParseError> for NetmodError {
fn from(err: AddrParseError) -> Self {
Self::InvalidBind(err.to_string())
}
}