mirror of
https://github.com/fluencelabs/rust-libp2p
synced 2025-07-30 16:31:57 +00:00
fix(swarm): better error message for failed DialPeerCondition
s
Closes #4407. Pull-Request: #4409.
This commit is contained in:
@@ -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