Skip to content

Commit

Permalink
core/src/transport: Don't print inner error when returning as source …
Browse files Browse the repository at this point in the history
…(#2533)

According to
rust-lang/project-error-handling#44 (comment),
we should not be printing the inner error AND returning it as source. Libraries
like `anyhow` will traverse the chain of `source` errors and build up a composed
error message. Printing it and returning the same error from `source` results in
duplicate error messages in that case.
  • Loading branch information
santos227 authored Mar 1, 2022
1 parent 34847e8 commit cd976c8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion core/src/transport.rs
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,7 @@ where
TransportError::MultiaddrNotSupported(addr) => {
write!(f, "Multiaddr is not supported: {}", addr)
}
TransportError::Other(err) => write!(f, "{}", err),
TransportError::Other(_) => Ok(()),
}
}
}
Expand Down

0 comments on commit cd976c8

Please sign in to comment.