reth_discv5/
error.rs

1//! Errors interfacing with [`discv5::Discv5`].
2
3/// Errors interfacing with [`discv5::Discv5`].
4#[derive(thiserror::Error, Debug)]
5pub enum Error {
6    /// Failure adding node to [`discv5::Discv5`].
7    #[error("failed adding node to discv5, {0}")]
8    AddNodeFailed(&'static str),
9    /// Node record has incompatible key type.
10    #[error("incompatible key type (not secp256k1)")]
11    IncompatibleKeyType,
12    /// No key used to identify rlpx network is configured.
13    #[error("network stack identifier is not configured")]
14    NetworkStackIdNotConfigured,
15    /// Missing key used to identify rlpx network.
16    #[error("fork missing on enr, key missing")]
17    ForkMissing(&'static [u8]),
18    /// Failed to decode [`ForkId`](reth_ethereum_forks::ForkId) rlp value.
19    #[error("failed to decode fork id, 'eth': {0:?}")]
20    ForkIdDecodeError(#[from] alloy_rlp::Error),
21    /// Peer is unreachable over discovery.
22    #[error("discovery socket missing")]
23    UnreachableDiscovery,
24    /// Failed to initialize [`discv5::Discv5`].
25    #[error("init failed, {0}")]
26    InitFailure(&'static str),
27    /// An error from underlying [`discv5::Discv5`] node.
28    #[error("sigp/discv5 error, {0}")]
29    Discv5Error(discv5::Error),
30    /// The [`ListenConfig`](discv5::ListenConfig) has been misconfigured.
31    #[error("misconfigured listen config, RLPx TCP address must also be supported by discv5")]
32    ListenConfigMisconfigured,
33}