hopr_network_types/
errors.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use thiserror::Error;

#[derive(Error, Debug)]
pub enum NetworkTypeError {
    #[error(transparent)]
    SessionProtocolError(#[from] crate::session::errors::SessionError),

    #[error("io error: {0}")]
    IoError(#[from] std::io::Error),

    #[error("the target is sealed")]
    SealedTarget,

    #[error("{0}")]
    Other(String),
}

pub type Result<T> = std::result::Result<T, NetworkTypeError>;