mirror of
https://github.com/fluencelabs/rust-libp2p
synced 2025-07-31 17:01:58 +00:00
fix(swarm): better error message for failed DialPeerCondition
s
Closes #4407. Pull-Request: #4409.
This commit is contained in:
2
Cargo.lock
generated
2
Cargo.lock
generated
@@ -3197,7 +3197,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "libp2p-swarm"
|
||||
version = "0.43.3"
|
||||
version = "0.43.4"
|
||||
dependencies = [
|
||||
"async-std",
|
||||
"either",
|
||||
|
@@ -92,7 +92,7 @@ libp2p-relay = { version = "0.16.1", path = "protocols/relay" }
|
||||
libp2p-rendezvous = { version = "0.13.0", path = "protocols/rendezvous" }
|
||||
libp2p-request-response = { version = "0.25.1", path = "protocols/request-response" }
|
||||
libp2p-server = { version = "0.12.2", path = "misc/server" }
|
||||
libp2p-swarm = { version = "0.43.3", path = "swarm" }
|
||||
libp2p-swarm = { version = "0.43.4", path = "swarm" }
|
||||
libp2p-swarm-derive = { version = "0.33.0", path = "swarm-derive" }
|
||||
libp2p-swarm-test = { version = "0.2.0", path = "swarm-test" }
|
||||
libp2p-tcp = { version = "0.40.0", path = "transports/tcp" }
|
||||
|
@@ -1,3 +1,10 @@
|
||||
## 0.43.4 - unreleased
|
||||
|
||||
- Improve error message when `DialPeerCondition` prevents a dial.
|
||||
See [PR 4409].
|
||||
|
||||
[PR 4409]: https://github.com/libp2p/rust-libp2p/pull/4409
|
||||
|
||||
## 0.43.3
|
||||
|
||||
- Implement `Display` for `ConnectionId`.
|
||||
|
@@ -3,7 +3,7 @@ name = "libp2p-swarm"
|
||||
edition = "2021"
|
||||
rust-version = { workspace = true }
|
||||
description = "The libp2p swarm"
|
||||
version = "0.43.3"
|
||||
version = "0.43.4"
|
||||
authors = ["Parity Technologies <admin@parity.io>"]
|
||||
license = "MIT"
|
||||
repository = "https://github.com/libp2p/rust-libp2p"
|
||||
|
@@ -1580,9 +1580,9 @@ impl fmt::Display for DialError {
|
||||
f,
|
||||
"Dial error: tried to dial local peer id at {endpoint:?}."
|
||||
),
|
||||
DialError::DialPeerConditionFalse(c) => {
|
||||
write!(f, "Dial error: condition {c:?} for dialing peer was false.")
|
||||
}
|
||||
DialError::DialPeerConditionFalse(PeerCondition::Disconnected) => write!(f, "Dial error: dial condition was configured to only happen when disconnected (`PeerCondition::Disconnected`), but node is already connected, thus cancelling new dial."),
|
||||
DialError::DialPeerConditionFalse(PeerCondition::NotDialing) => write!(f, "Dial error: dial condition was configured to only happen if there is currently no ongoing dialing attempt (`PeerCondition::NotDialing`), but a dial is in progress, thus cancelling new dial."),
|
||||
DialError::DialPeerConditionFalse(PeerCondition::Always) => unreachable!("Dial peer condition is by definition true."),
|
||||
DialError::Aborted => write!(
|
||||
f,
|
||||
"Dial error: Pending connection attempt has been aborted."
|
||||
|
Reference in New Issue
Block a user