grace: github.com/oxequa/grace Index | Files

package grace

import "github.com/oxequa/grace"

Index

Package Files

grace.go handler.go multiple.go recover.go

func Def Uses

func Def(e error, v ...interface{}) error

Def if error is nil return a new error with the interface as error value.

func Empty Uses

func Empty(e error) bool

Empty check if error message is an empty string.

func Equal Uses

func Equal(e1 error, e2 error) bool

Equal check if two errors are equal.

func New Uses

func New(v ...interface{}) error

New return an error created on the base of a given interface.

func Prefix Uses

func Prefix(e error, p ...interface{}) error

Prefix an error with one or a list of custom value.

func Set Uses

func Set(e error, v ...interface{}) error

Set if error is not nil return a new error with the interface as error value.

type HandlerFunc Uses

type HandlerFunc func(error) error

type Handlers Uses

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

func Handler Uses

func Handler(e error) *Handlers

func (*Handlers) Add Uses

func (h *Handlers) Add(f ...HandlerFunc) error

Add a list of handlers to a new error.

func (*Handlers) Get Uses

func (h *Handlers) Get() []HandlerFunc

Get a list of existing handler func

func (*Handlers) Loop Uses

func (h *Handlers) Loop() error

Loop a list of handlers on an error or multiple error.

type Multiple Uses

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

func Multi Uses

func Multi(e error) *Multiple

func (*Multiple) Add Uses

func (m *Multiple) Add(elems ...error) error

Append multiple errors to only one.

func (*Multiple) Get Uses

func (m *Multiple) Get() []error

Errors return a list of errors if exist.

type Recovery Uses

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

func Recover Uses

func Recover(e *error) *Recovery

Recover set an error pointer to recover error with stack trace.

func (*Recovery) Error Uses

func (rc *Recovery) Error()

Error set the error pointer to error message only

func (*Recovery) Stack Uses

func (rc *Recovery) Stack()

Stack set the error pointer to stack trace only

Package grace imports 3 packages (graph). Updated 2018-03-30. Refresh now. Tools for package owners.