mirror of
https://github.com/fluencelabs/rust-libp2p
synced 2025-06-26 16:21:39 +00:00
fix(swarm): display cause of denied listen error
The display of `ListenError` could be more helpful. The inner `cause` already implements `Error` which in turn requires `Display`. This is then just a matter of using said impl requirement to get an useful display Pull-Request: #4232.
This commit is contained in:
2
Cargo.lock
generated
2
Cargo.lock
generated
@ -3150,7 +3150,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "libp2p-swarm"
|
name = "libp2p-swarm"
|
||||||
version = "0.43.1"
|
version = "0.43.2"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"async-std",
|
"async-std",
|
||||||
"either",
|
"either",
|
||||||
|
@ -87,7 +87,7 @@ libp2p-quic = { version = "0.8.0-alpha", path = "transports/quic" }
|
|||||||
libp2p-relay = { version = "0.16.1", path = "protocols/relay" }
|
libp2p-relay = { version = "0.16.1", path = "protocols/relay" }
|
||||||
libp2p-rendezvous = { version = "0.13.0", path = "protocols/rendezvous" }
|
libp2p-rendezvous = { version = "0.13.0", path = "protocols/rendezvous" }
|
||||||
libp2p-request-response = { version = "0.25.1", path = "protocols/request-response" }
|
libp2p-request-response = { version = "0.25.1", path = "protocols/request-response" }
|
||||||
libp2p-swarm = { version = "0.43.1", path = "swarm" }
|
libp2p-swarm = { version = "0.43.2", path = "swarm" }
|
||||||
libp2p-swarm-derive = { version = "0.33.0", path = "swarm-derive" }
|
libp2p-swarm-derive = { version = "0.33.0", path = "swarm-derive" }
|
||||||
libp2p-swarm-test = { version = "0.2.0", path = "swarm-test" }
|
libp2p-swarm-test = { version = "0.2.0", path = "swarm-test" }
|
||||||
libp2p-tcp = { version = "0.40.0", path = "transports/tcp" }
|
libp2p-tcp = { version = "0.40.0", path = "transports/tcp" }
|
||||||
|
@ -1,3 +1,9 @@
|
|||||||
|
## 0.43.2 - unreleased
|
||||||
|
- Display the cause of a `ListenError::Denied`.
|
||||||
|
See [PR 4232]
|
||||||
|
|
||||||
|
[PR 4232]: https://github.com/libp2p/rust-libp2p/pull/4158
|
||||||
|
|
||||||
## 0.43.1
|
## 0.43.1
|
||||||
|
|
||||||
- Do not announce external address candidate before address translation, unless translation does not apply.
|
- Do not announce external address candidate before address translation, unless translation does not apply.
|
||||||
|
@ -3,7 +3,7 @@ name = "libp2p-swarm"
|
|||||||
edition = "2021"
|
edition = "2021"
|
||||||
rust-version = { workspace = true }
|
rust-version = { workspace = true }
|
||||||
description = "The libp2p swarm"
|
description = "The libp2p swarm"
|
||||||
version = "0.43.1"
|
version = "0.43.2"
|
||||||
authors = ["Parity Technologies <admin@parity.io>"]
|
authors = ["Parity Technologies <admin@parity.io>"]
|
||||||
license = "MIT"
|
license = "MIT"
|
||||||
repository = "https://github.com/libp2p/rust-libp2p"
|
repository = "https://github.com/libp2p/rust-libp2p"
|
||||||
|
@ -1684,8 +1684,8 @@ impl fmt::Display for ListenError {
|
|||||||
ListenError::Transport(_) => {
|
ListenError::Transport(_) => {
|
||||||
write!(f, "Listen error: Failed to negotiate transport protocol(s)")
|
write!(f, "Listen error: Failed to negotiate transport protocol(s)")
|
||||||
}
|
}
|
||||||
ListenError::Denied { .. } => {
|
ListenError::Denied { cause } => {
|
||||||
write!(f, "Listen error")
|
write!(f, "Listen error: Denied: {cause}")
|
||||||
}
|
}
|
||||||
ListenError::LocalPeerId { endpoint } => {
|
ListenError::LocalPeerId { endpoint } => {
|
||||||
write!(f, "Listen error: Local peer ID at {endpoint:?}.")
|
write!(f, "Listen error: Local peer ID at {endpoint:?}.")
|
||||||
|
Reference in New Issue
Block a user