-
Notifications
You must be signed in to change notification settings - Fork 202
/
errors.go
145 lines (97 loc) · 7.12 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
package heartbeat
import "errors"
// ErrNilPublicKeysMap signals that a nil public keys map has been provided
var ErrNilPublicKeysMap = errors.New("nil public keys map")
// ErrNilMessenger signals that a nil p2p messenger has been provided
var ErrNilMessenger = errors.New("nil P2P Messenger")
// ErrNilPrivateKey signals that a nil private key has been provided
var ErrNilPrivateKey = errors.New("nil private key")
// ErrNilMarshaller signals that a nil marshaller has been provided
var ErrNilMarshaller = errors.New("nil marshaller")
// ErrNilMessage signals that a nil message has been received
var ErrNilMessage = errors.New("nil message")
// ErrNilDataToProcess signals that nil data was provided
var ErrNilDataToProcess = errors.New("nil data to process")
// ErrInvalidMaxDurationPeerUnresponsive signals that the duration provided is invalid
var ErrInvalidMaxDurationPeerUnresponsive = errors.New("invalid max duration to declare the peer unresponsive")
// ErrNilAppStatusHandler defines the error for setting a nil AppStatusHandler
var ErrNilAppStatusHandler = errors.New("nil AppStatusHandler")
// ErrNilShardCoordinator signals that an operation has been attempted to or with a nil shard coordinator
var ErrNilShardCoordinator = errors.New("nil shard coordinator")
// ErrNilTimer signals that a nil time getter handler has been provided
var ErrNilTimer = errors.New("nil time getter handler")
// ErrNilPeerTypeProvider signals that a nil peer type provider has been given
var ErrNilPeerTypeProvider = errors.New("nil peer type provider")
// ErrNilMonitorDb signals that a nil monitor db was provided
var ErrNilMonitorDb = errors.New("nil monitor db")
// ErrNilMessageHandler signals that the provided message handler is nil
var ErrNilMessageHandler = errors.New("nil message handler")
// ErrNilHeartbeatStorer signals that the provided heartbeat storer is nil
var ErrNilHeartbeatStorer = errors.New("nil heartbeat storer")
// ErrFetchGenesisTimeFromDb signals that the genesis time cannot be fetched from db
var ErrFetchGenesisTimeFromDb = errors.New("monitor: can't get genesis time from db")
// ErrStoreGenesisTimeToDb signals that the genesis time cannot be store to db
var ErrStoreGenesisTimeToDb = errors.New("monitor: can't store genesis time")
// ErrUnmarshalGenesisTime signals that the unmarshaling of the genesis time didn't work
var ErrUnmarshalGenesisTime = errors.New("monitor: can't unmarshal genesis time")
// ErrMarshalGenesisTime signals that the marshaling of the genesis time didn't work
var ErrMarshalGenesisTime = errors.New("monitor: can't marshal genesis time")
// ErrPropertyTooLong signals that one of the properties is too long
var ErrPropertyTooLong = errors.New("property too long in Heartbeat")
// ErrNilNetworkShardingCollector defines the error for setting a nil network sharding collector
var ErrNilNetworkShardingCollector = errors.New("nil network sharding collector")
// ErrNilAntifloodHandler signals that a nil antiflood handler has been provided
var ErrNilAntifloodHandler = errors.New("nil antiflood handler")
// ErrNilHardforkTrigger signals that a nil hardfork trigger has been provided
var ErrNilHardforkTrigger = errors.New("nil hardfork trigger")
// ErrHeartbeatPidMismatch signals that a received hearbeat did not come from the correct originator
var ErrHeartbeatPidMismatch = errors.New("heartbeat peer id mismatch")
// ErrNilPubkeyConverter signals that a nil public key converter has been provided
var ErrNilPubkeyConverter = errors.New("trying to use a nil pubkey converter")
// ErrZeroHeartbeatRefreshIntervalInSec signals that a zero value was provided for the HeartbeatRefreshIntervalInSec
var ErrZeroHeartbeatRefreshIntervalInSec = errors.New("zero heartbeatRefreshInterval")
// ErrZeroHideInactiveValidatorIntervalInSec signals that a zero value
// was provided for the ErrZeroHideInactiveValidatorIntervalInSec
var ErrZeroHideInactiveValidatorIntervalInSec = errors.New("zero hideInactiveValidatorIntervalInSec")
// ErrInvalidDurationToConsiderUnresponsiveInSec is raised when a value less than 1 has been provided
var ErrInvalidDurationToConsiderUnresponsiveInSec = errors.New("value DurationToConsiderUnresponsiveInSec is less than 1")
// ErrNegativeMaxTimeToWaitBetweenBroadcastsInSec is raised when a value less than 1 has been provided
var ErrNegativeMaxTimeToWaitBetweenBroadcastsInSec = errors.New("value MaxTimeToWaitBetweenBroadcastsInSec is less than 1")
// ErrNegativeMinTimeToWaitBetweenBroadcastsInSec is raised when a value less than 1 has been provided
var ErrNegativeMinTimeToWaitBetweenBroadcastsInSec = errors.New("value MinTimeToWaitBetweenBroadcastsInSec is less than 1")
// ErrWrongValues signals that wrong values were provided
var ErrWrongValues = errors.New("wrong values for heartbeat parameters")
// ErrNilPeerSignatureHandler signals that a nil peerSignatureHandler object has been provided
var ErrNilPeerSignatureHandler = errors.New("trying to set nil peerSignatureHandler")
// ErrNilCurrentBlockProvider signals that a nil current block provider
var ErrNilCurrentBlockProvider = errors.New("nil current block provider")
// ErrNilRedundancyHandler signals that a nil redundancy handler was provided
var ErrNilRedundancyHandler = errors.New("nil redundancy handler")
// ErrEmptySendTopic signals that an empty topic string was provided
var ErrEmptySendTopic = errors.New("empty topic for sending messages")
// ErrInvalidTimeDuration signals that an invalid time duration was provided
var ErrInvalidTimeDuration = errors.New("invalid time duration")
// ErrInvalidThreshold signals that an invalid threshold was provided
var ErrInvalidThreshold = errors.New("invalid threshold")
// ErrNilRequestHandler signals that a nil request handler interface was provided
var ErrNilRequestHandler = errors.New("nil request handler")
// ErrNilNodesCoordinator signals that an operation has been attempted to or with a nil nodes coordinator
var ErrNilNodesCoordinator = errors.New("nil nodes coordinator")
// ErrNilPeerAuthenticationPool signals that a nil peer authentication pool has been provided
var ErrNilPeerAuthenticationPool = errors.New("nil peer authentication pool")
// ErrInvalidValue signals that an invalid value has been provided
var ErrInvalidValue = errors.New("invalid value")
// ErrNilRandomizer signals that a nil randomizer has been provided
var ErrNilRandomizer = errors.New("nil randomizer")
// ErrNilCacher signals that a nil cache has been provided
var ErrNilCacher = errors.New("nil cacher")
// ErrNilPeerShardMapper signals that a nil peer shard mapper has been provided
var ErrNilPeerShardMapper = errors.New("nil peer shard mapper")
// ErrNilEpochNotifier signals that a nil epoch notifier has been provided
var ErrNilEpochNotifier = errors.New("nil epoch notifier")
// ErrShouldSkipValidator signals that the validator should be skipped
var ErrShouldSkipValidator = errors.New("validator should be skipped")
// ErrNilHeartbeatMonitor signals that a nil heartbeat monitor was provided
var ErrNilHeartbeatMonitor = errors.New("nil heartbeat monitor")
// ErrNilHeartbeatSenderInfoProvider signals that a nil heartbeat sender info provider was provided
var ErrNilHeartbeatSenderInfoProvider = errors.New("nil heartbeat sender info provider")