#[non_exhaustive]pub enum Error {
Show 33 variants
NetworkContact,
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(Error),
ErrorMsg {
source: ErrorMsg,
op_id: OperationId,
},
ErrorCmd {
source: ErrorMsg,
msg_id: MsgId,
},
MessagingProtocol(Error),
SelfEncryption(Error),
ConfigError(Error),
IoError(Error),
EndpointSetup(ClientEndpointError),
QuicP2p(RpcError),
QuicP2pConnection(ConnectionError),
QuicP2pSend(SendError),
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
NetworkContact
Initial network contact failed
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
Could not connect to sufficient elder to retrieve reliable responses.
Fields
InsufficientElderKnowledge
Did not know of sufficient elders in the desired section to get supermajority of repsonses.
Fields
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(Error)
Other types errors
ErrorMsg
Errors received from the network via sn_messaging
Fields
op_id: OperationIdoperation ID that was used to send the query
ErrorCmd
Error response received for a client cmd sent to the network
MessagingProtocol(Error)
Errors occurred when serialising or deserialising msgs
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.
QuicP2pSend(SendError)
QuicP2p Send error.
Serialisation(Box<ErrorKind>)
Bincode error
NotEnoughChunksRetrieved
Could not retrieve all chunks required to decrypt the data. (expected, error)
Fields
NotAllDataWasChunked
Could not chunk all the data required to encrypt the data. (Expected, Actual)
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
Source§impl From<(Error, [u8; 32])> for Error
impl From<(Error, [u8; 32])> for Error
Source§fn from((source, op_id): (ErrorMsg, OperationId)) -> Self
fn from((source, op_id): (ErrorMsg, OperationId)) -> Self
Source§impl From<ClientEndpointError> for Error
impl From<ClientEndpointError> for Error
Source§fn from(source: ClientEndpointError) -> Self
fn from(source: ClientEndpointError) -> Self
Source§impl From<ConnectionError> for Error
impl From<ConnectionError> for Error
Source§fn from(source: ConnectionError) -> Self
fn from(source: ConnectionError) -> Self
Source§impl From<Error> for Error
impl From<Error> for Error
Source§fn from(source: MessagingError) -> Self
fn from(source: MessagingError) -> Self
Auto Trait Implementations§
impl !Freeze for Error
impl !RefUnwindSafe for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl !UnwindSafe 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
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