mirror of
https://github.com/fluencelabs/rust-libp2p
synced 2025-05-07 00:22:16 +00:00
core/src/transport: Don't print inner error when returning as source (#2533)
According to https://github.com/rust-lang/project-error-handling/issues/44#issuecomment-858151860, 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.
This commit is contained in:
parent
fd31d61a7f
commit
d1f472b3c0
@ -393,7 +393,7 @@ where
|
||||
TransportError::MultiaddrNotSupported(addr) => {
|
||||
write!(f, "Multiaddr is not supported: {}", addr)
|
||||
}
|
||||
TransportError::Other(err) => write!(f, "{}", err),
|
||||
TransportError::Other(_) => Ok(()),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user