2016-05-13 06:49:40 +03:00
|
|
|
// Copyright 2015 The etcd Authors
|
2015-01-25 06:19:16 +03:00
|
|
|
//
|
|
|
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
// you may not use this file except in compliance with the License.
|
|
|
|
// You may obtain a copy of the License at
|
|
|
|
//
|
|
|
|
// http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
//
|
|
|
|
// Unless required by applicable law or agreed to in writing, software
|
|
|
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
// See the License for the specific language governing permissions and
|
|
|
|
// limitations under the License.
|
2014-12-31 01:45:55 +03:00
|
|
|
|
|
|
|
package etcdserver
|
|
|
|
|
|
|
|
import (
|
|
|
|
"errors"
|
2015-09-25 00:48:18 +03:00
|
|
|
"fmt"
|
2014-12-31 01:45:55 +03:00
|
|
|
)
|
|
|
|
|
|
|
|
var (
|
2015-08-26 01:14:41 +03:00
|
|
|
ErrUnknownMethod = errors.New("etcdserver: unknown method")
|
|
|
|
ErrStopped = errors.New("etcdserver: server stopped")
|
|
|
|
ErrCanceled = errors.New("etcdserver: request cancelled")
|
|
|
|
ErrTimeout = errors.New("etcdserver: request timed out")
|
|
|
|
ErrTimeoutDueToLeaderFail = errors.New("etcdserver: request timed out, possibly due to previous leader failure")
|
|
|
|
ErrTimeoutDueToConnectionLost = errors.New("etcdserver: request timed out, possibly due to connection lost")
|
2016-08-13 22:41:04 +03:00
|
|
|
ErrTimeoutLeaderTransfer = errors.New("etcdserver: request timed out, leader transfer took too long")
|
2015-09-10 09:45:34 +03:00
|
|
|
ErrNotEnoughStartedMembers = errors.New("etcdserver: re-configuration failed due to not enough started members")
|
2016-01-20 08:09:09 +03:00
|
|
|
ErrNoLeader = errors.New("etcdserver: no leader")
|
2017-06-21 19:27:13 +03:00
|
|
|
ErrNotLeader = errors.New("etcdserver: not leader")
|
2016-02-08 23:44:25 +03:00
|
|
|
ErrRequestTooLarge = errors.New("etcdserver: request is too large")
|
2016-03-23 02:05:28 +03:00
|
|
|
ErrNoSpace = errors.New("etcdserver: no space")
|
2016-07-12 23:16:35 +03:00
|
|
|
ErrTooManyRequests = errors.New("etcdserver: too many requests")
|
2016-08-05 03:20:35 +03:00
|
|
|
ErrUnhealthy = errors.New("etcdserver: unhealthy cluster")
|
2016-12-05 23:14:50 +03:00
|
|
|
ErrKeyNotFound = errors.New("etcdserver: key not found")
|
2017-08-16 23:28:55 +03:00
|
|
|
ErrCorrupt = errors.New("etcdserver: corrupt cluster")
|
2014-12-31 01:45:55 +03:00
|
|
|
)
|
|
|
|
|
2015-10-28 00:39:38 +03:00
|
|
|
type DiscoveryError struct {
|
|
|
|
Op string
|
|
|
|
Err error
|
2015-09-25 00:48:18 +03:00
|
|
|
}
|
|
|
|
|
2015-10-28 00:39:38 +03:00
|
|
|
func (e DiscoveryError) Error() string {
|
|
|
|
return fmt.Sprintf("failed to %s discovery cluster (%v)", e.Op, e.Err)
|
2015-09-25 00:48:18 +03:00
|
|
|
}
|