mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-27 09:17:58 +00:00
Better error for spurious cache misses. (#4669)
Happened on Kusama for some not yet known reason.
This commit is contained in:
@@ -18,6 +18,7 @@
|
||||
//! Error handling related code and Error/Result definitions.
|
||||
|
||||
use polkadot_node_network_protocol::request_response::outgoing::RequestError;
|
||||
use polkadot_primitives::v1::SessionIndex;
|
||||
use thiserror::Error;
|
||||
|
||||
use futures::channel::oneshot;
|
||||
@@ -76,8 +77,8 @@ pub enum NonFatal {
|
||||
QueryAvailableDataResponseChannel(#[source] oneshot::Canceled),
|
||||
|
||||
/// We tried accessing a session that was not cached.
|
||||
#[error("Session is not cached.")]
|
||||
NoSuchCachedSession,
|
||||
#[error("Session {missing_session} is not cached, cached sessions: {available_sessions:?}.")]
|
||||
NoSuchCachedSession { available_sessions: Vec<SessionIndex>, missing_session: SessionIndex },
|
||||
|
||||
/// Sending request response failed (Can happen on timeouts for example).
|
||||
#[error("Sending a request's response failed.")]
|
||||
@@ -120,7 +121,7 @@ pub fn log_error(result: Result<()>, ctx: &'static str) -> std::result::Result<(
|
||||
match error {
|
||||
NonFatal::UnexpectedPoV |
|
||||
NonFatal::InvalidValidatorIndex |
|
||||
NonFatal::NoSuchCachedSession |
|
||||
NonFatal::NoSuchCachedSession { .. } |
|
||||
NonFatal::QueryAvailableDataResponseChannel(_) |
|
||||
NonFatal::QueryChunkResponseChannel(_) =>
|
||||
tracing::warn!(target: LOG_TARGET, error = %error, ctx),
|
||||
|
||||
Reference in New Issue
Block a user