error

package
v0.5.0-alpha.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 13, 2014 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EcodeKeyNotFound      = 100
	EcodeTestFailed       = 101
	EcodeNotFile          = 102
	EcodeNoMorePeer       = 103
	EcodeNotDir           = 104
	EcodeNodeExist        = 105
	EcodeKeyIsPreserved   = 106
	EcodeRootROnly        = 107
	EcodeDirNotEmpty      = 108
	EcodeExistingPeerAddr = 109

	EcodeValueRequired        = 200
	EcodePrevValueRequired    = 201
	EcodeTTLNaN               = 202
	EcodeIndexNaN             = 203
	EcodeValueOrTTLRequired   = 204
	EcodeTimeoutNaN           = 205
	EcodeNameRequired         = 206
	EcodeIndexOrValueRequired = 207
	EcodeIndexValueMutex      = 208
	EcodeInvalidField         = 209
	EcodeInvalidForm          = 210

	EcodeRaftInternal = 300
	EcodeLeaderElect  = 301

	EcodeWatcherCleared     = 400
	EcodeEventIndexCleared  = 401
	EcodeStandbyInternal    = 402
	EcodeInvalidActiveSize  = 403
	EcodeInvalidRemoveDelay = 404

	EcodeClientInternal = 500
)

Variables

This section is empty.

Functions

func Message

func Message(code int) string

Types

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

Only for error interface

func (Error) WriteTo

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL