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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
pub type Result<T> = std::result::Result<T, Error>;
#[derive(Debug, thiserror::Error)]
#[allow(clippy::large_enum_variant)]
pub enum Error {
#[error("Error when building indexation message: {0}")]
IndexationError(String),
#[error("Error when building transaction message")]
TransactionError,
#[error("The wallet account doesn't have enough balance. It only has {0}, required is {1}")]
NotEnoughBalance(u64, u64),
#[error(
"The wallet account has enough funds, but splitted on too many outputs: {0}, max. is 127, consolidate them"
)]
ConsolidationRequired(usize),
#[error("Dust error: {0}")]
DustError(String),
#[error("Must provide required parameter: {0}")]
MissingParameter(&'static str),
#[error("Parameter is invalid:{0}")]
InvalidParameter(&'static str),
#[error("No synced node available")]
SyncedNodePoolEmpty,
#[error("Failed to parse node_pool_urls")]
NodePoolUrlsError,
#[error("Failed to reach quorum {0} {1}")]
QuorumThresholdError(usize, usize),
#[error("Not enough nodes for quorum {0} {1}")]
QuorumPoolSizeError(usize, usize),
#[error("Node error: {0}")]
NodeError(String),
#[error("Failed to read node RwLock")]
NodeReadError,
#[error("{0}")]
FromHexError(#[from] hex::FromHexError),
#[error("{0}")]
MessageError(#[from] bee_message::Error),
#[error("{0}")]
BeeRestApiError(#[from] bee_rest_api::types::error::Error),
#[error("Message ID `{0}` doesn't need to be promoted or reattached")]
NoNeedPromoteOrReattach(String),
#[error("Message ID `{0}` couldn't get included into the Tangle")]
TangleInclusionError(String),
#[cfg(feature = "mqtt")]
#[error("{0}")]
MqttClientError(#[from] rumqttc::ClientError),
#[error("The MQTT topic {0} is invalid")]
InvalidMqttTopic(String),
#[error("MQTT connection not found (all nodes have the MQTT plugin disabled)")]
MqttConnectionNotFound,
#[error("{0}")]
IoError(#[from] std::io::Error),
#[error("{0}")]
Json(#[from] serde_json::Error),
#[error("{0}")]
Pow(String),
#[error("Address: {0} not found in range: {1}")]
InputAddressNotFound(String, String),
#[cfg(feature = "storage")]
#[error("Storage adapter not set {0}")]
StorageAdapterNotSet(String),
#[cfg(feature = "storage")]
#[error("Storage error {0}")]
Storage(String),
#[cfg(feature = "storage")]
#[error("Account not found")]
AccountNotFound,
#[error("{0}")]
CryptoError(#[from] crypto::Error),
#[error("{0}")]
MnemonicError(String),
#[error("Invalid amount of parents: {0}, length must be in 1..=8")]
InvalidParentsAmount(usize),
#[cfg(feature = "sync")]
#[error("{0}")]
UreqError(#[from] ureq::Error),
#[cfg(any(feature = "async", feature = "wasm"))]
#[error("Response error with status code {0}: {1}")]
ResponseError(u16, String),
#[cfg(any(feature = "async", feature = "wasm"))]
#[error("{0}")]
ReqwestError(#[from] reqwest::Error),
#[error("{0}")]
UrlError(#[from] url::ParseError),
#[error("{0}")]
UrlValidationError(String),
#[error("Can't set {0} to URL")]
UrlAuthError(String),
#[error("{0}")]
Blake2b256Error(&'static str),
#[error("Output error: {0}")]
OutputError(&'static str),
#[cfg(not(feature = "wasm"))]
#[error("{0}")]
TaskJoinError(#[from] tokio::task::JoinError),
#[error("Invalid mnemonic {0}")]
InvalidMnemonic(String),
#[error("{0}")]
PowError(#[from] bee_pow::providers::miner::Error),
#[error("Invalid API name")]
ApiError,
#[error("Rw lock failed")]
PoisonError,
}