Skip to content

The most "appropriate" way to match libp2p::TransportError::Other? #5114

Answered by thomaseizinger
gnattu asked this question in Q&A
Discussion options

You must be logged in to vote

In that case, I think your best bet is to walk the source chain of the error, try to downcast each one to an IO error and checking its ErrorKind.

In general, this seems like a very fragile way of going about it though. Also, note that we will automatically remove every address that generated a dial error from the routing table already:

if let DialError::Transport(addresses) = error {
for (addr, _) in addresses {
self.address_failed(peer_id, addr)
}
}

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@gnattu
Comment options

@thomaseizinger
Comment options

Answer selected by gnattu
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants