Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(swarm): improve error message on false DialPeerCondition #4407

Closed
mxinden opened this issue Aug 28, 2023 · 0 comments · Fixed by #4409
Closed

fix(swarm): improve error message on false DialPeerCondition #4407

mxinden opened this issue Aug 28, 2023 · 0 comments · Fixed by #4409
Labels
difficulty:easy getting-started Issues that can be tackled if you don't know the internals of libp2p very well help wanted

Comments

@mxinden
Copy link
Member

mxinden commented Aug 28, 2023

With PeerCondition::Disconnected, dialing an already connected peer results in the following error message:

Dial error: condition Disconnected for dialing peer was false

This is not intuitive for newcomers. Something along the lines of the below would be more intuitive:

Dial error: condition dial was configured to only happen when disconnected (`PeerCondition::Disconnected`), but node is already connected, thus cancelling new dial.

rust-libp2p/swarm/src/lib.rs

Lines 1583 to 1585 in e36e8ce

DialError::DialPeerConditionFalse(c) => {
write!(f, "Dial error: condition {c:?} for dialing peer was false.")
}

See e.g. confusion by user #4395

@mxinden mxinden added difficulty:easy help wanted getting-started Issues that can be tackled if you don't know the internals of libp2p very well labels Aug 28, 2023
@mergify mergify bot closed this as completed in #4409 Sep 6, 2023
mergify bot pushed a commit that referenced this issue Sep 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
difficulty:easy getting-started Issues that can be tackled if you don't know the internals of libp2p very well help wanted
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant