Repository navigation
Expand file tree
/
Copy patherrors.go
More file actions
77 lines (63 loc) · 3.61 KB
/
Copy patherrors.go
File metadata and controls
77 lines (63 loc) · 3.61 KB
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
package gorums
import (
"github.com/relab/gorums/internal/conn"
"github.com/relab/gorums/internal/impl"
"github.com/relab/gorums/internal/stream"
)
// ErrIncomplete is the error returned by a quorum call when the call cannot be completed
// due to insufficient non-error replies to form a quorum according to the quorum function.
var ErrIncomplete = impl.ErrIncomplete
// ErrSendFailure is the error returned by a multicast call when message sending
// fails for one or more nodes.
var ErrSendFailure = impl.ErrSendFailure
// ErrTypeMismatch is returned when a response cannot be cast to the expected type.
var ErrTypeMismatch = impl.ErrTypeMismatch
// ErrStreamDown is returned for a call whose target node's stream is
// unavailable, such as a call over a shared [WithStreamDedup] stream that is
// not connected (see [Server.WaitForAll]), or whose stream broke before the
// call's response arrived. The server may have handled a call that fails with
// ErrStreamDown, so a caller that retries the call must tolerate that the
// request reaches the server's handler twice. It is a gRPC status error with
// the Unavailable code; test for it with [errors.Is], also inside a
// [QuorumCallError]. The Unavailable code alone does not tell it apart from
// other node errors.
var ErrStreamDown = stream.ErrStreamDown
// ErrNodeClosed is returned for a call enqueued after its node was closed. It
// is a gRPC status error with the Unavailable code; test for it with
// [errors.Is]. The Unavailable code alone does not tell it apart from other
// node errors.
var ErrNodeClosed = stream.ErrNodeClosed
// ErrNoNode is the error of a remote call or unicast on a nil node.
// It is a gRPC status error with the InvalidArgument code; test for it with
// [errors.Is]. The InvalidArgument code alone does not tell it apart from
// [ErrEmptyConfig] or [ErrScatterCount].
var ErrNoNode = impl.ErrNoNode
// ErrEmptyConfig is the error of a quorum call or multicast on an empty
// configuration, such as one that [Config.Remove] or [Config.WithoutErrors]
// emptied. It is a gRPC status error with the InvalidArgument code; test for
// it with [errors.Is]. The InvalidArgument code alone does not tell it apart
// from [ErrNoNode] or [ErrScatterCount].
var ErrEmptyConfig = impl.ErrEmptyConfig
// ErrScatterCount is the error of a scatter call whose number of requests
// differs from the size of its configuration; the call sends nothing. It is a
// gRPC status error with the InvalidArgument code; test for it with
// [errors.Is]. The InvalidArgument code alone does not tell it apart from
// [ErrNoNode] or [ErrEmptyConfig].
var ErrScatterCount = impl.ErrScatterCount
// ErrSendQueueFull is the error of a request that a node cannot admit because
// its send queue is full; see [WithDialBufferSizes]. It is a gRPC status error
// with the Unavailable code; test for it with [errors.Is]. The Unavailable
// code alone does not tell it apart from other node errors.
var ErrSendQueueFull = stream.ErrSendQueueFull
// ErrSendStalled is reported by [Node.LastErr] while a send to the node has
// been blocked for a second or longer, as when the node has stopped reading
// its stream.
var ErrSendStalled = stream.ErrSendStalled
// ErrSkipNode is used to skip sending to a node whose request is nil or invalid.
var ErrSkipNode = impl.ErrSkipNode
// ErrStopped is returned by [Server.WaitForPeers], [Server.WaitForClients],
// and [Server.WaitForAll] when the server is stopped before the condition is met.
var ErrStopped = conn.ErrStopped
// QuorumCallError reports on a failed quorum call.
// It provides detailed information about which nodes failed.
type QuorumCallError = conn.QuorumCallError