Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

core/: Add display implementation for DialError<THandler> #2456

Closed
wants to merge 7 commits into from
4 changes: 4 additions & 0 deletions core/src/network.rs
Original file line number Diff line number Diff line change
Expand Up @@ -572,12 +572,16 @@ impl NetworkConfig {
#[derive(Debug, Clone, Error)]
pub enum DialError<THandler> {
/// The dialing attempt is rejected because of a connection limit.
#[error("The dialing attempt was rejected because of a connection limit: {limit}")]
ConnectionLimit {
limit: ConnectionLimit,
handler: THandler,
},
/// The dialing attempt is rejected because the peer being dialed is the local peer.
#[error("The dialing attempt was rejected because the peer being dialed is the local peer")]
LocalPeerId { handler: THandler },
/// The dialing attempt is rejected because the PeerId is invalid.
#[error("The dialing attempt was rejected because a valid PeerId could not be constructed from: {multihash:?}")]
InvalidPeerId {
handler: THandler,
multihash: Multihash,
Expand Down