The most "appropriate" way to match libp2p::TransportError::Other
?
#5114
-
I'm trying to make error handling logic for For example, the timeout Error is printed like I currently use |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Walking the source chain is likely the best option. Most errors will be But before you go down that rabbit hole, can you explain why you need to specific error that occurred? Maybe your problem can be solved in a different way. |
Beta Was this translation helpful? Give feedback.
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:
rust-libp2p/protocols/kad/src/behaviour.rs
Lines 2001 to 2005 in 1139f1c