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.
|
||||
#[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,
|
||||
|
|
Loading…
Reference in New Issue