diff --git a/zebra-network/src/peer/error.rs b/zebra-network/src/peer/error.rs index 2ad946aa5..adf83393f 100644 --- a/zebra-network/src/peer/error.rs +++ b/zebra-network/src/peer/error.rs @@ -11,6 +11,7 @@ pub struct SharedPeerError(#[from] Arc); /// An error related to peer connection handling. #[derive(Error, Debug)] +#[allow(dead_code)] pub enum PeerError { /// The remote peer closed the connection. #[error("Peer closed connection")] @@ -37,6 +38,14 @@ pub enum PeerError { /// disconnect from upon receipt. #[error("Remote peer sent an unsupported message type.")] UnsupportedMessage, + /// We got a `Reject` message. This does not necessarily mean that + /// the peer connection is in a bad state, but for the time being + /// we are considering it a PeerError. + // TODO: Create a different error type (more at the application + // level than network/connection level) that will include the + // appropriate error when a `Reject` message is received. + #[error("Received a Reject message")] + Rejected, /// The remote peer responded with a block we didn't ask for. #[error("Remote peer responded with a block we didn't ask for.")] WrongBlock,