errors

package module
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2021 License: MIT Imports: 4 Imported by: 10

README

errors

wrap caller stacks into err, similar to pkg/errors.

Feature

Unlike github.com/pkg/errors, multiple packaging caller stacks, this only packs the first time stack. This also applies to go.uber.org/zap.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Errorf added in v1.0.2

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

Errorf create a new error

func New

func New(msg string) error

New create a new error

func WithStack

func WithStack(err error) error

WithStack add caller stack information

func Wrap

func Wrap(err error, msg string) error

Wrap with some extra message into err

func Wrapf

func Wrapf(err error, format string, args ...interface{}) error

Wrapf with some extra message into err

Types

type Error

type Error interface {
	error
	// contains filtered or unexported methods
}

Error a error with caller stack information

Jump to

Keyboard shortcuts

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