#[non_exhaustive]pub enum ClientError {
Network(String),
Framing(TransportError),
CasMismatch {
ref_name: String,
expected: Cid,
actual: Cid,
},
Auth(String),
Protocol(String),
Serde(String),
}Expand description
Errors raised by the async HTTP RemoteClient (only meaningful
with the client feature). Kept separate from TransportError
so the pure-sync CAR surface stays free of async / reqwest types.
Variants split the failure modes a caller cares about:
Network- the HTTP request never reached a response (DNS, TLS, connect, body-read mid-flight). Retryable at the caller’s discretion.Framing- the response arrived but the CAR body was malformed. Not retryable on the same URL without a server fix; wraps the pure-syncTransportError.CasMismatch- the server rejectedadvance-headbecause the storedoldCID no longer matches the one the client sent. Caller must refresh refs and retry.Auth- 401 / 403 on a push endpoint. The bearer token is missing, expired, or lacks the required capability.Protocol- the server responded with an unexpected status code, missing header, or amnem-protocolversion mismatch.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Network(String)
Underlying HTTP request failed before a complete response was received (connect, TLS handshake, mid-body socket close, …).
Framing(TransportError)
CAR body received but failed framing / CID verification.
CasMismatch
advance-head rejected: the stored old value drifted between
the client’s read and its write. Caller refreshes refs and
retries.
Fields
Auth(String)
401 / 403 on a push endpoint. The bearer token is missing, expired, or lacks the required capability.
Protocol(String)
Server responded with an unexpected status code, missing
header, or mnem-protocol version mismatch.
Serde(String)
JSON serialisation or deserialisation failed. Only raised by
the client feature.
Trait Implementations§
Source§impl Debug for ClientError
impl Debug for ClientError
Source§impl Display for ClientError
impl Display for ClientError
Source§impl Error for ClientError
impl Error for ClientError
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<Error> for ClientError
Available on crate feature client only.
impl From<Error> for ClientError
client only.Source§impl From<Error> for ClientError
Available on crate feature client only.
impl From<Error> for ClientError
client only.Source§impl From<TransportError> for ClientError
impl From<TransportError> for ClientError
Source§fn from(source: TransportError) -> Self
fn from(source: TransportError) -> Self
Auto Trait Implementations§
impl Freeze for ClientError
impl !RefUnwindSafe for ClientError
impl Send for ClientError
impl Sync for ClientError
impl Unpin for ClientError
impl UnsafeUnpin for ClientError
impl !UnwindSafe for ClientError
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.