error_utils

package module
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2021 License: MIT Imports: 2 Imported by: 3

README

error-utils

Error Utilities

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ErrorByInterfaceType

func ErrorByInterfaceType(expected reflect.Type, err ...error) (theError error)

func ErrorByType

func ErrorByType(expected reflect.Type, err ...error) (theError error)

func IsError

func IsError(expected error, err ...error) (is bool)

func IsErrorTyp

func IsErrorTyp(expected reflect.Type, err ...error) (is bool)

func TraceOf

func TraceOf(err ...error) (st []byte)

func WalkErr

func WalkErr(cb func(err error) (stop bool), errs ...error) (stop bool)

Types

type Causer

type Causer interface {
	error
	Cause() error
}

type Errors

type Errors []error

Errors contains all happened errors

func (Errors) Add

func (errs Errors) Add(newErrors ...error) Errors

Add adds an error

func (Errors) Err

func (errs Errors) Err() error

Err gets the result error

func (Errors) Error

func (errs Errors) Error() string

error format happened errors

func (Errors) GetErrors

func (errs Errors) GetErrors() []error

GetErrors gets all happened errors

type Tracer

type Tracer interface {
	error
	Trace() []byte
}

Jump to

Keyboard shortcuts

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