pub enum SyncError {
ForwardVersion {
album: String,
entry_version: String,
max_known: String,
},
Rewind {
album: String,
entry_seq: u64,
high_water: u64,
},
MalformedProtocol(String),
MalformedManifest(String),
Rejected {
code: Option<String>,
message: String,
},
Transport(String),
Auth(AuthError),
}Expand description
Everything the sync consumer / reconciliation can fail with. Callers switch on
the typed variant (never a bare gRPC status); SyncError::error_code yields
the stable error.* catalog code where one applies.
Variants§
ForwardVersion
A feed entry’s protocol_version is above the client’s max known — the
forward-version rejection. The whole page is refused with no partial apply.
Fields
Rewind
A feed entry’s sync_seq regresses against the locally-seen high-water mark
for its album — a malicious/buggy server attempting to rewind the client.
Fields
MalformedProtocol(String)
A feed entry carried a protocol_version that is not a YYYY-MM-DD date.
MalformedManifest(String)
A feed entry’s manifest_cbor, or one of its derivative_manifests, is not base64.
The feed is JSON and a manifest is CBOR, so the signed bytes ride base64. A body that fails to decode is a server that cannot be talked to, not an asset to quarantine.
Rejected
The server rejected the call (cursor invalid, forward-version, auth, …).
Carries the stable error.* code when the server supplied one.
Fields
Transport(String)
Transport-level failure (connection, TLS, timeout, malformed metadata).
Auth(AuthError)
The session’s auth layer failed (not authenticated, refresh rejected).
Implementations§
Source§impl SyncError
impl SyncError
Sourcepub fn error_code(&self) -> Option<&str>
pub fn error_code(&self) -> Option<&str>
The stable error.* catalog code a client localizes, when one applies.
Sourcepub fn is_stale_cursor(&self) -> bool
pub fn is_stale_cursor(&self) -> bool
Whether the server refused the cursor because the library’s sync epoch moved: the server rebuilt its index and could not prove the numbering the cursor resumes (#697).
The recovery is SyncState::reset_for_resync and a pull from the start. Nothing the
client holds is discarded: the resync re-delivers what the server holds, and what it no
longer does is for the client to re-announce, never to delete.
Trait Implementations§
Source§impl Error for SyncError
impl Error for SyncError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
Source§impl From<SyncError> for FederationError
impl From<SyncError> for FederationError
Auto Trait Implementations§
impl !RefUnwindSafe for SyncError
impl !UnwindSafe for SyncError
impl Freeze for SyncError
impl Send for SyncError
impl Sync for SyncError
impl Unpin for SyncError
impl UnsafeUnpin for SyncError
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
§impl<T> CompatExt for T
impl<T> CompatExt for T
§impl<T, UT> HandleAlloc<UT> for T
impl<T, UT> HandleAlloc<UT> for T
§fn new_handle(value: Arc<T>) -> Handle
fn new_handle(value: Arc<T>) -> Handle
§unsafe fn clone_handle(handle: Handle) -> Handle
unsafe fn clone_handle(handle: Handle) -> Handle
§unsafe fn consume_handle(handle: Handle) -> Arc<T> ⓘ
unsafe fn consume_handle(handle: Handle) -> Arc<T> ⓘ
Arc<> Read more§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more