Enum iroh_blobs::get::fsm::DecodeError
source · pub enum DecodeError {
NotFound,
ParentNotFound(TreeNode),
LeafNotFound(ChunkNum),
ParentHashMismatch(TreeNode),
LeafHashMismatch(ChunkNum),
Read(ReadError),
Io(Error),
}
Expand description
Decode error that you can get once you have sent the request and are
decoding the response, e.g. from AtBlobContent::next
.
This is similar to [bao_tree::io::DecodeError
], but takes into account
that we are reading from a [RecvStream
], so read errors will be
propagated as DecodeError::Read
, containing a ReadError
.
This carries more concrete information about the error than an io::Error
.
When the provider finds that it does not have a chunk that we requested,
or that the chunk is invalid, it will stop sending data without producing
an error. This is indicated by either the DecodeError::ParentNotFound
or
DecodeError::LeafNotFound
variant, which can be used to detect that data
is missing but the connection as well that the provider is otherwise healthy.
The DecodeError::ParentHashMismatch
and DecodeError::LeafHashMismatch
variants indicate that the provider has sent us invalid data. A well-behaved
provider should never do this, so this is an indication that the provider is
not behaving correctly.
The DecodeError::Io
variant is just a fallback for any other io error that
is not actually a ReadError
.
Variants§
NotFound
A chunk was not found or invalid, so the provider stopped sending data
ParentNotFound(TreeNode)
A parent was not found or invalid, so the provider stopped sending data
LeafNotFound(ChunkNum)
A parent was not found or invalid, so the provider stopped sending data
ParentHashMismatch(TreeNode)
The hash of a parent did not match the expected hash
LeafHashMismatch(ChunkNum)
The hash of a leaf did not match the expected hash
Read(ReadError)
Error when reading from the stream
Io(Error)
A generic io error