exc

package module
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2023 License: MIT Imports: 3 Imported by: 0

README

EXC

A package of a better way to wrap error for golang.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Is

func Is(kind Kind, err error) bool

Is returns true if err contained a specific Kind. Deprecated: use IsKind()

func IsKind added in v0.0.5

func IsKind(err error, kind Kind) bool

IsKind returns true if err contained a specific Kind.

func New

func New(opts ...Option) error

func Wrap

func Wrap(err error, opts ...Option) error

Types

type Error

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

func (*Error) Error

func (e *Error) Error() string

func (*Error) Format

func (e *Error) Format(s fmt.State, v rune)

func (*Error) FormatError

func (e *Error) FormatError(p xerrors.Printer) error

func (*Error) LastKind

func (e *Error) LastKind() Kind

func (*Error) Unwrap

func (e *Error) Unwrap() error

type Kind

type Kind string

type Option

type Option interface {
	// contains filtered or unexported methods
}

func WithKind

func WithKind(k Kind) Option

func WithMessage

func WithMessage(msg string) Option

func WithMessagef

func WithMessagef(msg string, args ...interface{}) Option

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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