pub enum Error {
Show 20 variants
Network(String),
Storage(String),
Payment(String),
Protocol(String),
RemotePut {
address: String,
source: ProtocolError,
},
InvalidData(String),
Serialization(String),
Crypto(String),
Io(Error),
Config(String),
Timeout(String),
InsufficientPeers(String),
SignatureVerification(String),
Encryption(String),
Cancelled(String),
AlreadyStored,
BadQuoteBinding {
peer_id: String,
detail: String,
},
InsufficientDiskSpace(String),
CostEstimationInconclusive(String),
PartialUpload {
stored: Vec<[u8; 32]>,
stored_count: usize,
failed: Vec<([u8; 32], String)>,
failed_count: usize,
total_chunks: usize,
spend: Box<PartialUploadSpend>,
reason: String,
},
}Expand description
Errors that can occur in data operations.
Variants§
Network(String)
Network operation failed.
Storage(String)
Storage operation failed.
Payment(String)
Payment operation failed.
Protocol(String)
Protocol error.
RemotePut
A remote node rejected a chunk PUT at the application layer.
The node responded with a structured ProtocolError, so the
transport round-trip succeeded — this is an application-level
rejection (payment-failed, storage/disk-full, quote-stale,
merkle-pool-rejected), NOT evidence the client is sending too
fast. It therefore classifies as Outcome::ApplicationError
(see classify_error) and does not push the adaptive store
limiter down. The structured source is preserved (rather than
flattened into Protocol) so the controller — and a future
full-node skip-list (V2-469) — can key on the reason.
Fields
source: ProtocolErrorThe structured remote rejection reason.
InvalidData(String)
Invalid data received.
Serialization(String)
Serialization error.
Crypto(String)
Cryptographic error.
Io(Error)
I/O error.
Config(String)
Configuration error.
Timeout(String)
Timeout waiting for a response.
InsufficientPeers(String)
Insufficient peers for the operation.
SignatureVerification(String)
BLS signature verification failed.
Encryption(String)
Self-encryption operation failed.
Cancelled(String)
The operation was cancelled by the caller rather than failing.
Returned, for example, by streaming downloads when the consumer drops
its receiver (a client disconnect) — distinct from a transport
Error::Network failure, since nothing went wrong on the wire.
AlreadyStored
Data already exists on the network — no payment needed.
BadQuoteBinding
A peer’s quote pub_key does not BLAKE3-hash to the peer ID. The
storer would reject any ProofOfPayment containing this quote, so
the client drops the response before payment.
Fields
InsufficientDiskSpace(String)
Not enough disk space for the operation.
CostEstimationInconclusive(String)
Cost estimation could not reach a representative quote.
Returned by crate::data::Client::estimate_upload_cost when every
sampled chunk address reported AlreadyStored, so the network price
for the remainder of the file cannot be inferred from a sample.
The attached message describes how many addresses were tried.
PartialUpload
Upload partially succeeded – some chunks stored, some failed after retries.
The stored addresses can be used for progress tracking and resume.
Fields
spend: Box<PartialUploadSpend>On-chain spend incurred so far. Boxed to keep the Error enum small
(the variant is returned in Result across the crate; without the
box the two cost fields would trip clippy::result_large_err).
Trait Implementations§
Source§impl Error for Error
impl Error for Error
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()
Auto Trait Implementations§
impl !RefUnwindSafe for Error
impl !UnwindSafe for Error
impl Freeze for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl UnsafeUnpin for Error
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
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> 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