-
Notifications
You must be signed in to change notification settings - Fork 964
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
feat(swarm): make stream uprade errors more ergonomic #3882
Conversation
…-libp2p into feat/no-report-inbound-error
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change looks good to me. Just one comment.
/// No protocol could be agreed upon. | ||
NegotiationFailed, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As a side-note, we had multiple users complain, that it is hard to debug why the negotiation failed. What would have helped them is NegotiationFailed
to contain the protocols the local and the remote peer offered.
That said, using DEBUG
logging and looking for the multistream-select
lines also helps the debugging, though a bit harder to discover.
Not to be addressed in this pull request.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Including this information will be a breaking change but we can introduce the facilities for it in a non-breaking manner once we have completely encapsulated multistream-select
, meaning this is a step in the right direction in my opinion.
This comment was marked as resolved.
This comment was marked as resolved.
Co-authored-by: Max Inden <mail@max-inden.de>
…2p/rust-libp2p into 3759-encapsulate-multistream-select
Description
The currently provided
ConnectionHandlerUpgrErr
is very hard to use. Not only does it have a long name, it also features 3 levels of nesting which results in a lot of boilerplate. Last but not least, it exposesmultistream-select
as a dependency to all protocols.We fix all of the above by renaming the type to
StreamUpgradeError
and flattening out its interface. Unrecoverable errors during protocol selection are hidden within theIo
variant.Related: #3759.
Notes & open questions
Draft because it depends on #3605.Change checklist