errors

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2020 License: Apache-2.0, MIT Imports: 3 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Cause added in v0.2.0

func Cause(err error) error

Cause returns the underlying cause of the error, if possible. An error value has a cause if it implements the following interface:

type causer interface {
       Cause() error
}

If the error does not implement Cause, the original error will be returned. If the error is nil, nil will be returned without further investigation.

func IsGroup added in v0.2.0

func IsGroup(name string, err error) bool

func IsKind added in v0.2.0

func IsKind(group, kind string, err error) bool

Types

type Categorized

type Categorized interface {
	error
	Group() string
	Kind() string
	Cause() error
}

func Newf

func Newf(group, kind string, objs []interface{}, format string, args ...interface{}) Categorized

func Wrapf

func Wrapf(cause error, group, kind string, objs []interface{}, format string, args ...interface{}) Categorized

type Formal

type Formal interface {
	Categorized
	Arg(n int) interface{}
	Length() int
}

type FormalType

type FormalType struct {
	Type
	// contains filtered or unexported fields
}

func DeclareFormalType

func DeclareFormalType(group, kind, format string) *FormalType

func (*FormalType) New

func (this *FormalType) New(args ...interface{}) Categorized

func (*FormalType) Newf

func (this *FormalType) Newf(objs []interface{}, format string, args ...interface{}) Categorized

func (*FormalType) Wrap

func (this *FormalType) Wrap(cause error, args ...interface{}) Categorized

type GroupKind

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

func (*GroupKind) Group

func (this *GroupKind) Group() string

func (*GroupKind) Kind

func (this *GroupKind) Kind() string

type StackTracer

type StackTracer interface {
	StackTrace() errors.StackTrace
}

type Type

type Type struct {
	GroupKind
}

func DeclareType

func DeclareType(group, kind string) *Type

func (*Type) Newf

func (this *Type) Newf(format string, args ...interface{}) Categorized

func (*Type) Wrapf

func (this *Type) Wrapf(cause error, format string, args ...interface{}) Categorized

Jump to

Keyboard shortcuts

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