1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
use crate::{
agreement::ProposalError,
messages::{CreateError, ExtendProofChainError},
};
use qp2p::Error as Qp2pError;
use secured_linked_list::error::Error as SecuredLinkedListError;
use std::net::SocketAddr;
use thiserror::Error;
use xor_name::XorName;
pub type Result<T, E = Error> = std::result::Result<T, E>;
#[derive(Debug, Error)]
#[allow(missing_docs)]
pub enum Error {
#[error("Failed signature check.")]
FailedSignature,
#[error("Cannot route.")]
CannotRoute,
#[error("Empty recipient list")]
EmptyRecipientList,
#[error("The config is invalid: {err}")]
InvalidConfig {
#[source]
err: Qp2pError,
},
#[error("Cannot connect to the endpoint: {err}")]
CannotConnectEndpoint {
#[source]
err: Qp2pError,
},
#[error("Address not reachable: {err}")]
AddressNotReachable {
#[source]
err: Qp2pError,
},
#[error("The node is not in a state to handle the action.")]
InvalidState,
#[error("Invalid source location.")]
InvalidSrcLocation,
#[error("Invalid destination location.")]
InvalidDstLocation,
#[error("Content of a received message is inconsistent.")]
InvalidMessage,
#[error("A signature share is invalid.")]
InvalidSignatureShare,
#[error("The secret key share is missing.")]
MissingSecretKeyShare,
#[error("Failed to send a message to {0}, {1}")]
FailedSend(SocketAddr, XorName),
#[error("Connection closed locally")]
ConnectionClosed,
#[error("Invalid section chain: {0}")]
InvalidSectionChain(#[from] SecuredLinkedListError),
#[error("Messaging protocol error: {0}")]
Messaging(#[from] sn_messaging::Error),
#[error("proposal error: {0}")]
ProposalError(#[from] ProposalError),
#[error("create error: {0}")]
CreateError(#[from] CreateError),
#[error("extend proof error: {0}")]
ExtendProofError(#[from] ExtendProofChainError),
#[error("invalid payload")]
InvalidPayload,
#[error("Routing is set to not allow taking any new node")]
TryJoinLater,
#[error("No matching Section")]
NoMatchingSection,
#[error("No matching Elder")]
NoMatchingElder,
}