logo
#[non_exhaustive]
pub enum Error {
Show 30 variants GenesisKeyMismatch, CouldNotReadHomeDir, CouldNotCreateSafeDir, ReceivedUnexpectedEvent, NoNetworkKnowledge, IncomingMessages, InsufficientElderConnections { connections: usize, required: usize, }, InsufficientElderKnowledge { connections: usize, required: usize, section_pk: PublicKey, }, PeerConnection(SocketAddr), EmptyFileProvided, TooSmallForSelfEncryption, SmallFilePaddingNeeded, TooLargeAsSmallFile, QueryTimedOut, NoEncryptionObject, NoResponse, UnknownOperationId, UnexpectedQueryResponse(QueryResponse), NetworkDataError(DtError), ErrorMessage { source: ErrorMessage, op_id: OperationId, }, MessagingProtocol(MessagingError), SelfEncryption(Error), ConfigError(Error), IoError(Error), EndpointSetup(ClientEndpointError), QuicP2p(RpcError), QuicP2pConnection(ConnectionError), Serialisation(Box<ErrorKind>), NotEnoughChunksRetrieved { expected: usize, retrieved: usize, }, NotAllDataWasChunked { expected: usize, chunked: usize, },
}
Expand description

Client Errors

Variants (Non-exhaustive)

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.

GenesisKeyMismatch

Genesis Key from the config and the PrefixMap mismatch

CouldNotReadHomeDir

Error reading home dir for client

CouldNotCreateSafeDir

Error creating root dir for client

ReceivedUnexpectedEvent

Received unexpected event.

NoNetworkKnowledge

Client has not gone through qp2p bootstrap process yet

IncomingMessages

qp2p’s IncomingMessages errores

InsufficientElderConnections

Fields

connections: usize

Number of existing connections to Elders

required: usize

Minimum number of connections to Elders required for the operation

Could not connect to sufficient elder to retrieve reliable responses.

InsufficientElderKnowledge

Fields

connections: usize

Number of existing connections to Elders

required: usize

Minimum number of connections to Elders required for the operation

section_pk: PublicKey

Public key of the target section

Did not know of sufficient elders in the desired section to get supermajority of repsonses.

PeerConnection(SocketAddr)

Peer connection retrieval failed

EmptyFileProvided

Cannot store empty file..

TooSmallForSelfEncryption

Not enough bytes for self-encryption.

SmallFilePaddingNeeded

Encryption oversized the SmallFile, so it cannot be stored as a SmallFile and be encrypted

TooLargeAsSmallFile

The provided bytes is too large to store as a SmallFile.

QueryTimedOut

No query response before timeout

NoEncryptionObject

Could not get an encryption object.

NoResponse

Could not query elder.

UnknownOperationId

No operation Id could be found

UnexpectedQueryResponse(QueryResponse)

Unexpected response received

NetworkDataError(DtError)

Other types errors

ErrorMessage

Fields

source: ErrorMessage

The source of an error message

op_id: OperationId

operation ID that was used to send the query

Errors received from the network via sn_messaging

MessagingProtocol(MessagingError)

Errors occurred when serialising or deserialising messages

SelfEncryption(Error)

self_enryption errors

ConfigError(Error)

Other types errors

IoError(Error)

Io error.

EndpointSetup(ClientEndpointError)

Endpoint setup error.

QuicP2p(RpcError)

QuicP2p error.

QuicP2pConnection(ConnectionError)

QuicP2p Connection error.

Serialisation(Box<ErrorKind>)

Bincode error

NotEnoughChunksRetrieved

Fields

expected: usize

Number of Chunks expected to be retrieved

retrieved: usize

Number of Chunks retrieved

Could not retrieve all chunks required to decrypt the data. (expected, error)

NotAllDataWasChunked

Fields

expected: usize

Number of Chunks expected to be generated

chunked: usize

Number of Chunks generated

Could not chunk all the data required to encrypt the data. (Expected, Actual)

Trait Implementations

Formats the value using the given formatter. Read more

Formats the value using the given formatter. Read more

The lower-level source of this error, if any. Read more

🔬 This is a nightly-only experimental API. (backtrace)

Returns a stack backtrace, if available, of where this error occurred. Read more

👎 Deprecated since 1.42.0:

use the Display impl or to_string()

👎 Deprecated since 1.33.0:

replaced by Error::source, which can support downcasting

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Performs the conversion.

The alignment of pointer.

The type for initializers.

Initializes a with the given initializer. Read more

Dereferences the given pointer. Read more

Mutably dereferences the given pointer. Read more

Drops the object pointed to by the given pointer. Read more

Should always be Self

Converts the given value to a String. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more