Skip to content

Commit

Permalink
core/: Add Display implementation for DialError (#2473)
Browse files Browse the repository at this point in the history
Co-authored-by: Frederik Baetens <baetens.fr@gmail.com>
  • Loading branch information
mxinden and Frederik-Baetens committed Feb 3, 2022
1 parent 3f4dbb1 commit 1b6ffb1
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Expand Up @@ -45,6 +45,7 @@
## Version 0.43.0 [unreleased]

- Update individual crates.
- `libp2p-core`
- `libp2p-gossipsub`
- `libp2p-metrics`

Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Expand Up @@ -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 }
Expand Down
6 changes: 6 additions & 0 deletions 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.
Expand Down
2 changes: 1 addition & 1 deletion core/Cargo.toml
Expand Up @@ -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 <admin@parity.io>"]
license = "MIT"
repository = "https://github.com/libp2p/rust-libp2p"
Expand Down
4 changes: 4 additions & 0 deletions core/src/network.rs
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

0 comments on commit 1b6ffb1

Please sign in to comment.