errors

package
v0.0.0-...-88364e3 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2017 License: MIT Imports: 2 Imported by: 23

Documentation

Index

Constants

View Source
const (
	// ErrIsClosed is intended to be used when an action is attempted on a closed instance
	ErrIsClosed = Error("cannot perform action on a closed instance")
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Error

type Error string

Error is a constant error type

func (Error) Error

func (err Error) Error() string

Error is the error interface implementation

func (Error) Fmt

func (err Error) Fmt(args ...interface{}) error

Fmt returns a formated error based on the current error

type ErrorList

type ErrorList struct {
	// contains filtered or unexported fields
}

ErrorList is used to chain a list of potential errors and is thread-safe.

func (*ErrorList) Copy

func (e *ErrorList) Copy(in *ErrorList)

Copy will copy the items from the inbound error list to the source

func (*ErrorList) Err

func (e *ErrorList) Err() (err error)

Err will return an error if the errorlist is not empty. If there's only 1 error, it will be directly returned. If the errorlist is empty - nil is returned.

func (*ErrorList) Error

func (e *ErrorList) Error() string

Error will return the string-form of the errors. Implements the error interface.

func (*ErrorList) ForEach

func (e *ErrorList) ForEach(fn func(error))

ForEach will iterate through all of the errors within the error list.

func (*ErrorList) Len

func (e *ErrorList) Len() (n int)

Len will return the length of the inner errors list.

func (*ErrorList) Push

func (e *ErrorList) Push(err error)

Push will push an error to the errorlist If err is a errorlist, it will be merged. If the errorlist is nil, it will be created.

Jump to

Keyboard shortcuts

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