dberr

package
v0.0.1-tiedot Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2014 License: GPL-3.0, BSD-2-Clause Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// IO error
	GeneralError = iota

	// Document errors
	DocDoesNotExist = iota
	DocTooLarge     = iota
	DocIsLocked     = iota

	// Query input errors
	QueryNeedIndex       = iota
	QueryMissingSubQuery = iota
	QueryMalformedInt    = iota
	QueryMissingParam    = iota
)

Variables

View Source
var (
	// IO error
	ErrorIO = Error{GeneralError, "IO error has occured, see log for more details.", ""}

	// Document errors
	ErrorNoDoc       = Error{DocDoesNotExist, "Document `%d` does not exist", ""}
	ErrorDocTooLarge = Error{DocTooLarge, "Document is too large. Max: `%d`, Given: `%d`", ""}
	ErrorDocLocked   = Error{DocIsLocked, "Document `%d` is locked for update - try again later", ""}

	// Query input errors
	ErrorNeedIndex         = Error{QueryNeedIndex, "Please index %v and retry query %v.", ""}
	ErrorExpectingSubQuery = Error{QueryMissingSubQuery, "Expecting a vector of sub-queries, but %v given.", ""}
	ErrorExpectingInt      = Error{QueryMalformedInt, "Expecting `%s` as an integer, but %v given.", ""}
	ErrorMissing           = Error{QueryMissingParam, "Missing `%s`", ""}
)

Functions

This section is empty.

Types

type Error

type Error struct {
	Code        int
	Err         string
	WithDetails string
}

func (Error) Error

func (e Error) Error() string

func (Error) Fault

func (e Error) Fault(details ...interface{}) Error

Jump to

Keyboard shortcuts

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