-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Fix error handling in Swarm dial() and listen_on() #55
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
Conversation
df5585e to
7aee015
Compare
|
Rebased over master ; travis tests won't pass because of #61 |
7aee015 to
ff2fe98
Compare
| let negotiated = multistream_select::listener_select_proto(connection, iter); | ||
| negotiated.map(move |(upgrade_id, conn)| (upgrade_id, conn, upgrade, client_addr)) | ||
| .map_err(|_| panic!()) // TODO: | ||
| .map_err(|err| IoError::new(IoErrorKind::Other, err)) |
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.
Style nit: I prefer use std::io; to use std::io::Error as IoError;, but that could be argued as personal taste.
| } | ||
|
|
||
| fn cause(&self) -> Option<&error::Error> { | ||
| match *self { |
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.
Style nit: maybe use an if let?
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.
Nit: A match is better if we add more variants in the future
|
|
||
| fn cause(&self) -> Option<&error::Error> { | ||
| match *self { | ||
| MultistreamSelectError::IoError(ref err) => { |
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.
Why do we repeat Error/MultistreamSelect twice in this? Can it be enum Error { Io(...), ... }? We know we're in the multistream select crate already.
ff2fe98 to
809ff7e
Compare
…lidation for received staged ledger parts re: libp2p#55
No description provided.