/
errors.go
261 lines (175 loc) · 12.7 KB
/
errors.go
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
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
package dataRetriever
import (
"errors"
)
// ErrNilMessage signals that a nil message has been received
var ErrNilMessage = errors.New("nil message")
// ErrSendRequest signals that the connected peers list is empty or errors appeared when sending requests
var ErrSendRequest = errors.New("cannot send request: peer list is empty or errors during the sending")
// ErrNilValue signals the value is nil
var ErrNilValue = errors.New("nil value")
// ErrTxNotFoundInBlockPool signals that transaction was not found in the current block pool
var ErrTxNotFoundInBlockPool = errors.New("transaction was not found in the current block pool")
// ErrValidatorInfoNotFoundInEpochPool signals that validator info was not found in the current epoch pool
var ErrValidatorInfoNotFoundInEpochPool = errors.New("validator info was not found in the current epoch pool")
// ErrNilMarshalizer signals that an operation has been attempted to or with a nil Marshalizer implementation
var ErrNilMarshalizer = errors.New("nil Marshalizer")
// ErrNilStore signals that the provided storage service is nil
var ErrNilStore = errors.New("nil data storage service")
// ErrNilMessenger signals that a nil Messenger object was provided
var ErrNilMessenger = errors.New("nil Messenger")
// ErrNilTxDataPool signals that a nil transaction pool has been provided
var ErrNilTxDataPool = errors.New("nil transaction data pool")
// ErrNilUnsignedTransactionPool signals that a nil unsigned transactions pool has been provided
var ErrNilUnsignedTransactionPool = errors.New("nil unsigned transactions data pool")
// ErrNilRewardTransactionPool signals that a nil reward transactions pool has been provided
var ErrNilRewardTransactionPool = errors.New("nil reward transaction data pool")
// ErrNilHeadersDataPool signals that a nil header pool has been provided
var ErrNilHeadersDataPool = errors.New("nil headers data pool")
// ErrNilShardCoordinator signals that an operation has been attempted to or with a nil shard coordinator
var ErrNilShardCoordinator = errors.New("nil shard coordinator")
// ErrNilDataToProcess signals that nil data was provided
var ErrNilDataToProcess = errors.New("nil data to process")
// ErrNilTxStorage signals that a nil transaction storage has been provided
var ErrNilTxStorage = errors.New("nil transaction storage")
// ErrNilHeadersStorage signals that a nil header storage has been provided
var ErrNilHeadersStorage = errors.New("nil headers storage")
// ErrNilHeadersNoncesStorage signals that a nil header-nonce storage has been provided
var ErrNilHeadersNoncesStorage = errors.New("nil headers nonces storage")
// ErrNilResolverSender signals that a nil resolver sender object has been provided
var ErrNilResolverSender = errors.New("nil resolver sender")
// ErrInvalidNonceByteSlice signals that an invalid byte slice has been provided
// and an uint64 can not be decoded from that byte slice
var ErrInvalidNonceByteSlice = errors.New("invalid nonce byte slice")
// ErrResolveTypeUnknown signals that an unknown resolve type was provided
var ErrResolveTypeUnknown = errors.New("unknown resolve type")
// ErrNilMiniblocksPool signals that a nil miniblocks pool has been provided
var ErrNilMiniblocksPool = errors.New("nil miniblocks pool")
// ErrNilMiniblocksStorage signals that a nil miniblocks storage has been provided
var ErrNilMiniblocksStorage = errors.New("nil miniblocks storage")
// ErrNilDataPoolHolder signals that the data pool holder is nil
var ErrNilDataPoolHolder = errors.New("nil data pool holder")
// ErrNilContainerElement signals when trying to add a nil element in the container
var ErrNilContainerElement = errors.New("element cannot be nil")
// ErrInvalidContainerKey signals that an element does not exist in the container's map
var ErrInvalidContainerKey = errors.New("element does not exist in container")
// ErrContainerKeyAlreadyExists signals that an element was already set in the container's map
var ErrContainerKeyAlreadyExists = errors.New("provided key already exists in container")
// ErrNilUint64ByteSliceConverter signals that a nil byte slice converter was provided
var ErrNilUint64ByteSliceConverter = errors.New("nil byte slice converter")
// ErrNilResolverContainer signals that a nil resolver container was provided
var ErrNilResolverContainer = errors.New("nil resolver container")
// ErrWrongTypeInContainer signals that a wrong type of object was found in container
var ErrWrongTypeInContainer = errors.New("wrong type of object inside container")
// ErrLenMismatch signals that 2 or more slices have different lengths
var ErrLenMismatch = errors.New("lengths mismatch")
// ErrNilPeerChangeBlockDataPool signals that a nil peer change pool has been provided
var ErrNilPeerChangeBlockDataPool = errors.New("nil peer change block data pool")
// ErrNilTxBlockDataPool signals that a nil tx block body pool has been provided
var ErrNilTxBlockDataPool = errors.New("nil tx block data pool")
// ErrCacheConfigInvalidSizeInBytes signals that the cache parameter "sizeInBytes" is invalid
var ErrCacheConfigInvalidSizeInBytes = errors.New("cache parameter [sizeInBytes] is not valid, it must be a positive, and large enough number")
// ErrCacheConfigInvalidSize signals that the cache parameter "size" is invalid
var ErrCacheConfigInvalidSize = errors.New("cache parameter [size] is not valid, it must be a positive number")
// ErrCacheConfigInvalidShards signals that the cache parameter "shards" is invalid
var ErrCacheConfigInvalidShards = errors.New("cache parameter [shards] is not valid, it must be a positive number")
// ErrCacheConfigInvalidEconomics signals that an economics parameter required by the cache is invalid
var ErrCacheConfigInvalidEconomics = errors.New("cache-economics parameter is not valid")
// ErrCacheConfigInvalidSharding signals that a sharding parameter required by the cache is invalid
var ErrCacheConfigInvalidSharding = errors.New("cache-sharding parameter is not valid")
// ErrNilTrieNodesPool signals that a nil trie nodes data pool was provided
var ErrNilTrieNodesPool = errors.New("nil trie nodes data pool")
// ErrNilTrieNodesChunksPool signals that a nil trie nodes chunks data pool was provided
var ErrNilTrieNodesChunksPool = errors.New("nil trie nodes chunks data pool")
// ErrNoSuchStorageUnit defines the error for using an invalid storage unit
var ErrNoSuchStorageUnit = errors.New("no such unit type")
// ErrNilRandomizer signals that a nil randomizer has been provided
var ErrNilRandomizer = errors.New("nil randomizer")
// ErrRequestTypeNotImplemented signals that a not implemented type of request has been received
var ErrRequestTypeNotImplemented = errors.New("request type is not implemented")
// ErrNilDataPacker signals that a nil data packer has been provided
var ErrNilDataPacker = errors.New("nil data packer provided")
// ErrNilResolverFinder signals that a nil resolver finder has been provided
var ErrNilResolverFinder = errors.New("nil resolvers finder")
// ErrInvalidMaxTxRequest signals that max tx request is too small
var ErrInvalidMaxTxRequest = errors.New("max tx request number is invalid")
// ErrNilPeerListCreator signals that a nil peer list creator implementation has been provided
var ErrNilPeerListCreator = errors.New("nil peer list creator provided")
// ErrNilPeersRatingHandler signals that a nil peers rating handler implementation has been provided
var ErrNilPeersRatingHandler = errors.New("nil peers rating handler")
// ErrNilTrieDataGetter signals that a nil trie data getter has been provided
var ErrNilTrieDataGetter = errors.New("nil trie data getter provided")
// ErrNilCurrBlockTxs signals that nil current block txs holder was provided
var ErrNilCurrBlockTxs = errors.New("nil current block txs holder")
// ErrNilCurrentEpochValidatorInfo signals that nil current epoch validator info holder was provided
var ErrNilCurrentEpochValidatorInfo = errors.New("nil current epoch validator info holder")
// ErrNilRequestedItemsHandler signals that a nil requested items handler was provided
var ErrNilRequestedItemsHandler = errors.New("nil requested items handler")
// ErrNilEpochHandler signals that epoch handler is nil
var ErrNilEpochHandler = errors.New("nil epoch handler")
// ErrBadRequest signals that the request should not have happened
var ErrBadRequest = errors.New("request should not be done as it doesn't follow the protocol")
// ErrNilAntifloodHandler signals that a nil antiflood handler has been provided
var ErrNilAntifloodHandler = errors.New("nil antiflood handler")
// ErrNilPreferredPeersHolder signals that a nil preferred peers holder handler has been provided
var ErrNilPreferredPeersHolder = errors.New("nil preferred peers holder")
// ErrNilSelfShardIDProvider signals that a nil self shard ID provider has been provided
var ErrNilSelfShardIDProvider = errors.New("nil self shard ID provider")
// ErrNilCurrentNetworkEpochProvider signals that a nil CurrentNetworkEpochProvider handler has been provided
var ErrNilCurrentNetworkEpochProvider = errors.New("nil current network epoch provider")
// ErrSystemBusy signals that the system is busy and can not process more requests
var ErrSystemBusy = errors.New("system busy")
// ErrNilThrottler signals that a nil throttler has been provided
var ErrNilThrottler = errors.New("nil throttler")
// ErrEmptyString signals that an empty string has been provided
var ErrEmptyString = errors.New("empty string")
// ErrInvalidValue signals that an invalid value has been provided
var ErrInvalidValue = errors.New("invalid value")
// ErrNilWhiteListHandler signals that white list handler is nil
var ErrNilWhiteListHandler = errors.New("nil white list handler")
// ErrRequestIntervalTooSmall signals that request interval is too small
var ErrRequestIntervalTooSmall = errors.New("request interval is too small")
// ErrNilResolverDebugHandler signals that a nil resolver debug handler has been provided
var ErrNilResolverDebugHandler = errors.New("nil resolver debug handler")
// ErrMissingData signals that the required data is missing
var ErrMissingData = errors.New("missing data")
// ErrNilConfig signals that a nil config has been provided
var ErrNilConfig = errors.New("nil config provided")
// ErrNilEconomicsData signals that a nil economics data handler has been provided
var ErrNilEconomicsData = errors.New("nil economics data provided")
// ErrNilTxGasHandler signals that a nil tx gas handler was provided
var ErrNilTxGasHandler = errors.New("nil tx gas handler provided")
// ErrNilManualEpochStartNotifier signals that a nil manual epoch start notifier has been provided
var ErrNilManualEpochStartNotifier = errors.New("nil manual epoch start notifier")
// ErrNilGracefullyCloseChannel signals that a nil gracefully close channel has been provided
var ErrNilGracefullyCloseChannel = errors.New("nil gracefully close channel")
// ErrNilSmartContractsPool signals that a nil smart contracts pool has been provided
var ErrNilSmartContractsPool = errors.New("nil smart contracts pool")
// ErrNilHasher signals that a nil hasher has been provided
var ErrNilHasher = errors.New("nil hasher")
// ErrNilTrieStorageManager signals that a nil trie storage manager has been provided
var ErrNilTrieStorageManager = errors.New("nil trie storage manager")
// ErrNilPathManager signals that a nil path manager has been provided
var ErrNilPathManager = errors.New("nil path manager")
// ErrNilEpochNotifier signals that the provided EpochNotifier is nil
var ErrNilEpochNotifier = errors.New("nil EpochNotifier")
// ErrNilPeerAuthenticationPool signals that a nil peer authentication pool has been provided
var ErrNilPeerAuthenticationPool = errors.New("nil peer authentication pool")
// ErrNilHeartbeatPool signals that a nil heartbeat pool has been provided
var ErrNilHeartbeatPool = errors.New("nil heartbeat pool")
// ErrPeerAuthNotFound signals that no peer authentication found
var ErrPeerAuthNotFound = errors.New("peer authentication not found")
// ErrNilNodesCoordinator signals a nil nodes coordinator has been provided
var ErrNilNodesCoordinator = errors.New("nil nodes coordinator")
// ErrNilPayloadValidator signals that a nil payload validator was provided
var ErrNilPayloadValidator = errors.New("nil payload validator")
// ErrWrongTypeAssertion signals that a type assertion failed
var ErrWrongTypeAssertion = errors.New("wrong type assertion")
// ErrStorerNotFound signals that the storer was not found
var ErrStorerNotFound = errors.New("storer not found")
// ErrNilValidatorInfoPool signals that a nil validator info pool has been provided
var ErrNilValidatorInfoPool = errors.New("nil validator info pool")
// ErrNilValidatorInfoStorage signals that a nil validator info storage has been provided
var ErrNilValidatorInfoStorage = errors.New("nil validator info storage")
// ErrValidatorInfoNotFound signals that no validator info was found
var ErrValidatorInfoNotFound = errors.New("validator info not found")