errors

package
v0.0.0-...-1c9a7a8 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2023 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	P0 = Priority(iota)
	P1
	P2
	P3
	P4
	P5
)

Variables

View Source
var New = errors.New

Functions

func As

func As(err error, target any) bool

func Deferred

func Deferred(
	err *error,
	ef func() error,
)

func DeferredChan

func DeferredChan(
	ch chan<- error,
	f func() error,
)

func DeferredChanError

func DeferredChanError(
	err *error,
	ch <-chan error,
)

func DeferredCloser

func DeferredCloser(
	err *error,
	c io.Closer,
)

func DeferredFlusher

func DeferredFlusher(
	err *error,
	f Flusher,
)

func Errf

func Errf(f string, a ...interface{})

func Error

func Error(err error)

func Errorf

func Errorf(f string, values ...interface{}) (err errer)

func Implement

func Implement() (err error)

func Is

func Is(err, target error) bool

func IsAsNilOrWrapf

func IsAsNilOrWrapf(
	err error,
	target error,
	format string,
	values ...interface{},
) (out error)

func IsBrokenPipe

func IsBrokenPipe(err error) bool

func IsEOF

func IsEOF(err error) bool

func IsErrno

func IsErrno(err error, target syscall.Errno) (ok bool)

func IsExist

func IsExist(err error) bool

func IsNotExist

func IsNotExist(err error) bool

func IsTooManyOpenFiles

func IsTooManyOpenFiles(err error) bool

func IsVerbose

func IsVerbose() bool

func Join

func Join(es ...error) error

func MakeMulti

func MakeMulti(errs ...error) (em *multi)

func Normal

func Normal(err error) *normalError

func Normalf

func Normalf(fmt string, args ...interface{}) *normalError

func PanicIfError

func PanicIfError(err interface{})

func PrintErr

func PrintErr(a ...interface{}) (err error)

func PrintErrf

func PrintErrf(f string, a ...interface{}) (err error)

func SetTesting

func SetTesting()

func SetTodoOn

func SetTodoOn()

func SetVerbose

func SetVerbose()

func Split

func Split(err error) (out []error)

func Todo

func Todo(f string, a ...interface{}) (err error)

func TodoP0

func TodoP0(f string, a ...interface{}) (err error)

func TodoP1

func TodoP1(f string, a ...interface{}) (err error)

func TodoP2

func TodoP2(f string, a ...interface{}) (err error)

func TodoP3

func TodoP3(f string, a ...interface{}) (err error)

func TodoP4

func TodoP4(f string, a ...interface{}) (err error)

func TodoP5

func TodoP5(f string, a ...interface{}) (err error)

func TodoRecoverable

func TodoRecoverable(f string, a ...interface{}) (err error)

func Unwrap

func Unwrap(err error) error

func Wrap

func Wrap(in error) (err errer)

func WrapN

func WrapN(n int, in error) (err errer)

func Wrapf

func Wrapf(in error, f string, values ...interface{}) (err errer)

Types

type DevPrinter

type DevPrinter interface {
	ProdPrinter
	Caller(i int, f string, vs ...interface{})
	FunctionName(skip int)
}

func Debug

func Debug() DevPrinter

func Log

func Log() DevPrinter

type Flusher

type Flusher interface {
	Flush() error
}

type Iser

type Iser interface {
	error
	Is(error) bool
}

type Logger

type Logger interface {
	Print(v ...interface{})
	Printf(format string, v ...interface{})
}

type Multi

type Multi interface {
	error
	Add(error)
	Empty() bool
}

type Priority

type Priority int

func (Priority) String

func (i Priority) String() string

type ProdPrinter

type ProdPrinter interface {
	Print(v ...interface{}) error
	Printf(format string, v ...interface{}) error
}

func Err

func Err() ProdPrinter

func Out

func Out() ProdPrinter

type StackInfo

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

func MakeStackInfo

func MakeStackInfo(d int) (si StackInfo, ok bool)

func MakeStackInfos

func MakeStackInfos(depth, count int) (si []StackInfo)

func (StackInfo) Errorf

func (si StackInfo) Errorf(f string, values ...interface{}) (err errer)

func (StackInfo) String

func (si StackInfo) String() string

func (StackInfo) Wrap

func (si StackInfo) Wrap(in error) (err errer)

func (StackInfo) Wrapf

func (si StackInfo) Wrapf(in error, f string, values ...interface{}) (err errer)

type StackTracer

type StackTracer interface {
	error
	ShouldShowStackTrace() bool
}

type Unwrapper

type Unwrapper interface {
	error
	Unwrap() error
}

Jump to

Keyboard shortcuts

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