errors

package
v0.2.15 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ConnectionClosed = Code(iota)
	UnableToOpenConnection
	ConnectionCloseError
	DatabaseClosed
	DatabaseCloseError
	OperationNotSupported
	OperationNotPermitted
	UnableToListDatabases
	InvalidDatabaseName
	DatabaseAlreadyExists
	DatabaseDoesNotExist
	UnableToCreateDatabase
	UnableToDeleteDatabase
	UnableToConnectToDatabase
	UnableToListTables
	InvalidTableName
	CreateTableError
	DeleteTableError
	TableDoesNotExist
	UnableToConnectToTable
	TableClosed
	TableCloseError
	DescribeError
	CountError
	InsertError
	UpdateError
	SelectError
	LimitOutOfRange
	DeleteError
	TemplateFailsToValidate
	SelectorFailsToValidate
	ConditionFailsToValidate
	SortFailsToValidate
	ReplacementFailsToValidate
	RecordFailsToValidate
	RecordUnsupportedType
	RecordMalformedKey
	RecordUnableToDecodeValue
	RecordUnableToEncodeValue
	RecordUnableToConvertType
	IterationNotStarted
	IterationError
	IterationFinished
	IterationCloseError
	ListIndexError
	InvalidKey
	AddIndexError
	DeleteIndexError
	AddKeyError
	DeleteKeyError
	RenameTableError
)

The valid error codes.

Variables

This section is empty.

Functions

func ShouldWrap

func ShouldWrap(e error) bool

ShouldWrap returns true if e satisfies all of the following:

  • e is not nil;
  • e is not equal to io.EOF;
  • e is not equal to one of context.Canceled or context.DeadlineExceeded;
  • e is does not satisfy the Error interface.

Types

type Code

type Code int

Code represents a common keyvalue error.

func (Code) New

func (c Code) New() error

New returns a new error with error code c. The error satisfies the Error interface.

func (Code) String

func (c Code) String() string

String returns a description of the error with error code c.

func (Code) Wrap

func (c Code) Wrap(e error) error

Wrap returns a new error with error code c and cause e. The error satisfies the Error interface.

type Error

type Error interface {
	// Code returns the code associated with this error.
	Code() Code
	// Error returns a string description of the error.
	Error() string
}

Error is the interface satisfied by an error with a Code.

Jump to

Keyboard shortcuts

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