errors

package module
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2021 License: MIT Imports: 4 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func As

func As(err, target error) bool

func Errorf

func Errorf(format string, a ...interface{}) error

func Is

func Is(err, target error) bool

func Multi

func Multi(err error, errs ...error) error

func New

func New(text string) error

func Opaque

func Opaque(err error) error

func Unfold

func Unfold(err error) []error

func Unwrap

func Unwrap(err error) error

func Wrap

func Wrap(err error) error

Types

type Frame

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

A Frame contains part of a call stack.

func Caller

func Caller(skip int) Frame

Caller returns a Frame that describes a frame on the caller's stack. The argument skip is the number of frames to skip over. Caller(0) returns the frame for the caller of Caller.

func (Frame) Format

func (f Frame) Format(p xerrors.Printer)

Format prints the stack as error detail. It should be called from an error's Format implementation after printing any other error detail.

func (Frame) Location

func (f Frame) Location() (function, file string, line int)

location reports the file, line, and function of a frame.

The returned function may be "" even if file and line are not.

Jump to

Keyboard shortcuts

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