mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-10-27 14:09:49 +00:00
Don't change rep on timeout in collator protocol. (#4642)
* Don't change rep on timeout in collator protocol. * Fix tests. * Fixes.
This commit is contained in:
1 parent
712b53f468
commit
83c8afcbb9
3 files changed
+37
-70
No files matched your search
@@ -94,6 +94,20 @@ pub enum RequestError {
|
||||
Canceled(#[source] oneshot::Canceled),
|
||||
}
|
||||
|
||||
impl RequestError {
|
||||
/// Whether the error represents some kind of timeout condition.
|
||||
pub fn is_timed_out(&self) -> bool {
|
||||
match self {
|
||||
Self::Canceled(_) |
|
||||
Self::NetworkError(network::RequestFailure::Obsolete) |
|
||||
Self::NetworkError(network::RequestFailure::Network(
|
||||
network::OutboundFailure::Timeout,
|
||||
)) => true,
|
||||
_ => false,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// A request to be sent to the network bridge, including a sender for sending responses/failures.
|
||||
///
|
||||
/// The network implementation will make use of that sender for informing the requesting subsystem
|
||||
|
||||
Reference in new issue
Block a user