etcd: github.com/etcd-io/etcd/etcdserver/api/v2error Index | Files

package v2error

import "github.com/etcd-io/etcd/etcdserver/api/v2error"

Package v2error describes errors in etcd project. When any change happens, Documentation/v2/errorcode.md needs to be updated correspondingly. To be deprecated in favor of v3 APIs.

Index

Package Files

error.go

Constants

const (
    EcodeKeyNotFound = 100
    EcodeTestFailed  = 101
    EcodeNotFile     = 102

    EcodeNotDir    = 104
    EcodeNodeExist = 105

    EcodeRootROnly   = 107
    EcodeDirNotEmpty = 108

    EcodeUnauthorized = 110

    EcodePrevValueRequired = 201
    EcodeTTLNaN            = 202
    EcodeIndexNaN          = 203

    EcodeInvalidField       = 209
    EcodeInvalidForm        = 210
    EcodeRefreshValue       = 211
    EcodeRefreshTTLRequired = 212

    EcodeRaftInternal = 300
    EcodeLeaderElect  = 301

    EcodeWatcherCleared    = 400
    EcodeEventIndexCleared = 401
)

type Error Uses

type Error struct {
    ErrorCode int    `json:"errorCode"`
    Message   string `json:"message"`
    Cause     string `json:"cause,omitempty"`
    Index     uint64 `json:"index"`
}

func NewError Uses

func NewError(errorCode int, cause string, index uint64) *Error

func NewRequestError Uses

func NewRequestError(errorCode int, cause string) *Error

func (Error) Error Uses

func (e Error) Error() string

Error is for the error interface

func (Error) StatusCode Uses

func (e Error) StatusCode() int

func (Error) WriteTo Uses

func (e Error) WriteTo(w http.ResponseWriter) error

Package v2error imports 3 packages (graph). Updated 2018-08-28. Refresh now. Tools for package owners.