at protocol indexer with flexible filtering, xrpc queries, and a cursor-backed event stream, built on fjall
at-protocol atproto indexer rust fjall

[backfill] print root cause of transport errors

ptr.pet 75d3bc5c 0a89d674

verified
+11 -1
+11 -1
src/backfill/mod.rs
··· 5 5 use crate::types::{AccountEvt, BroadcastEvent, RepoState, RepoStatus, ResyncState, StoredEvent}; 6 6 use futures::TryFutureExt; 7 7 use jacquard::api::com_atproto::sync::get_repo::{GetRepo, GetRepoError}; 8 + use jacquard::error::{ClientError, ClientErrorKind}; 8 9 use jacquard::types::cid::Cid; 9 10 use jacquard::types::did::Did; 10 11 use jacquard::{CowStr, IntoStatic, prelude::*}; ··· 132 133 .into_diagnostic()??; 133 134 } 134 135 Err(e) => { 135 - error!("backfill failed for {did}: {e}"); 136 + { 137 + if e.downcast_ref::<ClientError>() 138 + .map_or(false, |e| matches!(e.kind(), ClientErrorKind::Transport)) 139 + { 140 + let reason = e.root_cause(); 141 + error!("backfill failed for {did}: {e}: {reason}"); 142 + } else { 143 + warn!("backfill failed for {did}: {e}"); 144 + } 145 + } 136 146 let did_key = keys::repo_key(&did); 137 147 138 148 // 1. get current retry count