Back to godoc.org
go.etcd.io/etcd / error

Package error

v3.1.10+incompatible
Latest Go to latest

The latest major version is .

Published: Jul 14, 2017 | License: Apache-2.0 | Module: go.etcd.io/etcd

Overview

Package error describes errors in etcd project. When any change happens, Documentation/v2/errorcode.md needs to be updated correspondingly.

Index

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

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

func NewError

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

func NewRequestError

func NewRequestError(errorCode int, cause string) *Error

func (Error) Error

func (e Error) Error() string

Error is for the error interface

func (Error) StatusCode

func (e Error) StatusCode() int

func (Error) WriteTo

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

Package Files

Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to identifier