reinstate reject error variant
This commit is contained in:
parent
4dc307f2f3
commit
8276bed400
|
|
@ -11,6 +11,7 @@ pub struct SharedPeerError(#[from] Arc<PeerError>);
|
||||||
|
|
||||||
/// An error related to peer connection handling.
|
/// An error related to peer connection handling.
|
||||||
#[derive(Error, Debug)]
|
#[derive(Error, Debug)]
|
||||||
|
#[allow(dead_code)]
|
||||||
pub enum PeerError {
|
pub enum PeerError {
|
||||||
/// The remote peer closed the connection.
|
/// The remote peer closed the connection.
|
||||||
#[error("Peer closed connection")]
|
#[error("Peer closed connection")]
|
||||||
|
|
@ -37,6 +38,14 @@ pub enum PeerError {
|
||||||
/// disconnect from upon receipt.
|
/// disconnect from upon receipt.
|
||||||
#[error("Remote peer sent an unsupported message type.")]
|
#[error("Remote peer sent an unsupported message type.")]
|
||||||
UnsupportedMessage,
|
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.
|
/// The remote peer responded with a block we didn't ask for.
|
||||||
#[error("Remote peer responded with a block we didn't ask for.")]
|
#[error("Remote peer responded with a block we didn't ask for.")]
|
||||||
WrongBlock,
|
WrongBlock,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue