use thiserror::Error;
use zeromq::ZmqError;

use super::ServiceType;

#[derive(Error, Debug)]
pub enum NetError {
    #[error("Failed to connect to remote service: {0}")]
    ConnectFail(#[source] ZmqError),
    #[error("Failed to bind: {0}")]
    BindFail(#[source] ZmqError),
    #[error("Failed to send data to remote service: {0}")]
    SendFail(#[source] ZmqError),
    #[error("Recv failed: {0}")]
    RecvFail(#[source] ZmqError),
    #[error("Service with app id {0} not found")]
    MissingAppId(u32),
    #[error("No service of type {0:?}")]
    MissingServiceType(ServiceType),
}
