forked from hashicorp/consul
-
Notifications
You must be signed in to change notification settings - Fork 0
/
errors.go
28 lines (24 loc) · 949 Bytes
/
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
package structs
import (
"errors"
"strings"
)
const (
errNoLeader = "No cluster leader"
errNoDCPath = "No path to datacenter"
errNoServers = "No known Consul servers"
errNotReadyForConsistentReads = "Not ready to serve consistent reads"
errSegmentsNotSupported = "Network segments are not supported in this version of Consul"
errRPCRateExceeded = "RPC rate limit exceeded"
)
var (
ErrNoLeader = errors.New(errNoLeader)
ErrNoDCPath = errors.New(errNoDCPath)
ErrNoServers = errors.New(errNoServers)
ErrNotReadyForConsistentReads = errors.New(errNotReadyForConsistentReads)
ErrSegmentsNotSupported = errors.New(errSegmentsNotSupported)
ErrRPCRateExceeded = errors.New(errRPCRateExceeded)
)
func IsErrRPCRateExceeded(err error) bool {
return strings.Contains(err.Error(), errRPCRateExceeded)
}