mirror of
https://github.com/fluencelabs/rust-libp2p
synced 2025-06-26 00:01:33 +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:
@ -1684,8 +1684,8 @@ impl fmt::Display for ListenError {
|
||||
ListenError::Transport(_) => {
|
||||
write!(f, "Listen error: Failed to negotiate transport protocol(s)")
|
||||
}
|
||||
ListenError::Denied { .. } => {
|
||||
write!(f, "Listen error")
|
||||
ListenError::Denied { cause } => {
|
||||
write!(f, "Listen error: Denied: {cause}")
|
||||
}
|
||||
ListenError::LocalPeerId { endpoint } => {
|
||||
write!(f, "Listen error: Local peer ID at {endpoint:?}.")
|
||||
|
Reference in New Issue
Block a user