hopr_transport_network/
errors.rsuse libp2p_identity::PeerId;
use thiserror::Error;
#[derive(Error, Debug)]
pub enum NetworkingError {
#[error("the network operation timed out after {0} seconds")]
Timeout(u64),
#[error("error in the messaging sub-protocol: {0}")]
MessagingError(String),
#[error("error while decoding message data")]
DecodingError,
#[error("performing an operation on own PeerId")]
DisallowedOperationOnOwnPeerIdError,
#[error("db error: {0}")]
DbError(#[from] hopr_db_api::errors::DbError),
#[error("peer does not exist")]
NonExistingPeer,
#[error("error while pinging peer {0}: {1}")]
PingerError(PeerId, String),
#[error("{0}")]
Other(String),
}
pub type Result<T> = core::result::Result<T, NetworkingError>;