From 1b6ffb116439276625f3d95abda2d6bb431088be Mon Sep 17 00:00:00 2001 From: Max Inden Date: Thu, 3 Feb 2022 12:49:01 +0100 Subject: [PATCH] core/: Add Display implementation for DialError (#2473) Co-authored-by: Frederik Baetens --- CHANGELOG.md | 1 + Cargo.toml | 2 +- core/CHANGELOG.md | 6 ++++++ core/Cargo.toml | 2 +- core/src/network.rs | 4 ++++ 5 files changed, 13 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 02651a02f9c..c017a808054 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -45,6 +45,7 @@ ## Version 0.43.0 [unreleased] - Update individual crates. + - `libp2p-core` - `libp2p-gossipsub` - `libp2p-metrics` diff --git a/Cargo.toml b/Cargo.toml index 47f9aed0f4e..6f839b238d0 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -77,7 +77,7 @@ instant = "0.1.11" # Explicit dependency to be used in `wasm-bindgen` feature lazy_static = "1.2" libp2p-autonat = { version = "0.1.0", path = "protocols/autonat", optional = true } -libp2p-core = { version = "0.31.0", path = "core", default-features = false } +libp2p-core = { version = "0.31.1", path = "core", default-features = false } libp2p-floodsub = { version = "0.33.0", path = "protocols/floodsub", optional = true } libp2p-gossipsub = { version = "0.36.0", path = "./protocols/gossipsub", optional = true } libp2p-identify = { version = "0.33.0", path = "protocols/identify", optional = true } diff --git a/core/CHANGELOG.md b/core/CHANGELOG.md index 8dcc6500a2a..db20358479c 100644 --- a/core/CHANGELOG.md +++ b/core/CHANGELOG.md @@ -1,3 +1,9 @@ +# 0.31.1 [unreleased] + +- Implement `Display` on `DialError`. See [PR 2456]. + +[PR 2456]: https://github.com/libp2p/rust-libp2p/pull/2456 + # 0.31.0 [2022-01-27] - Update dependencies. diff --git a/core/Cargo.toml b/core/Cargo.toml index a60134bb4eb..822911d3c7a 100644 --- a/core/Cargo.toml +++ b/core/Cargo.toml @@ -3,7 +3,7 @@ name = "libp2p-core" edition = "2021" rust-version = "1.56.1" description = "Core traits and structs of libp2p" -version = "0.31.0" +version = "0.31.1" authors = ["Parity Technologies "] license = "MIT" repository = "https://github.com/libp2p/rust-libp2p" diff --git a/core/src/network.rs b/core/src/network.rs index f2aba473d4e..046cb9d48a0 100644 --- a/core/src/network.rs +++ b/core/src/network.rs @@ -572,12 +572,16 @@ impl NetworkConfig { #[derive(Debug, Clone, Error)] pub enum DialError { /// 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,