blob: d0fe28970d120f86bcda2e64e1fba055f6bc9423 [file] [log] [blame]
khenaidooab1f7bd2019-11-14 14:00:27 -05001// Copyright 2015 The etcd Authors
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15package etcdserver
16
17import (
18 "errors"
19 "fmt"
20)
21
22var (
23 ErrUnknownMethod = errors.New("etcdserver: unknown method")
24 ErrStopped = errors.New("etcdserver: server stopped")
25 ErrCanceled = errors.New("etcdserver: request cancelled")
26 ErrTimeout = errors.New("etcdserver: request timed out")
27 ErrTimeoutDueToLeaderFail = errors.New("etcdserver: request timed out, possibly due to previous leader failure")
28 ErrTimeoutDueToConnectionLost = errors.New("etcdserver: request timed out, possibly due to connection lost")
29 ErrTimeoutLeaderTransfer = errors.New("etcdserver: request timed out, leader transfer took too long")
30 ErrLeaderChanged = errors.New("etcdserver: leader changed")
31 ErrNotEnoughStartedMembers = errors.New("etcdserver: re-configuration failed due to not enough started members")
32 ErrLearnerNotReady = errors.New("etcdserver: can only promote a learner member which is in sync with leader")
33 ErrNoLeader = errors.New("etcdserver: no leader")
34 ErrNotLeader = errors.New("etcdserver: not leader")
35 ErrRequestTooLarge = errors.New("etcdserver: request is too large")
36 ErrNoSpace = errors.New("etcdserver: no space")
37 ErrTooManyRequests = errors.New("etcdserver: too many requests")
38 ErrUnhealthy = errors.New("etcdserver: unhealthy cluster")
39 ErrKeyNotFound = errors.New("etcdserver: key not found")
40 ErrCorrupt = errors.New("etcdserver: corrupt cluster")
41 ErrBadLeaderTransferee = errors.New("etcdserver: bad leader transferee")
42)
43
44type DiscoveryError struct {
45 Op string
46 Err error
47}
48
49func (e DiscoveryError) Error() string {
50 return fmt.Sprintf("failed to %s discovery cluster (%v)", e.Op, e.Err)
51}