myerrors

package module
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2019 License: MIT Imports: 3 Imported by: 1

README

myerrors

Package which helps me to deal with errors:

  • Wraps github.com/pkg/errors package to support new interfaces in go 1.13 errors
  • Adds func StackTrace(error)
  • Adds Handler interface which is used in my packages
  • Adds func Merge(error, error)
  • Adds functions to handle errors in defer

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CallWrapd added in v1.1.1

func CallWrapd(err *error, fn func() error, msg string)

func CallWrapfd added in v1.1.1

func CallWrapfd(err *error, fn func() error, format string, args ...interface{})

func Calld added in v1.1.0

func Calld(err *error, fn func() error)

func Errorf

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

func Merge added in v1.1.0

func Merge(errA, errB error) error

func New

func New(message string) error

func StackTrace

func StackTrace(err error) pkgerrors.StackTrace

func WithStack

func WithStack(err error) error

func Wrap

func Wrap(err error, msg string) error

func Wrapd added in v1.1.0

func Wrapd(err *error, msg string)

func Wrapf

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

func Wrapfd added in v1.1.0

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

Types

type Handler

type Handler interface {
	Handle(error)
}

func SafeHandler

func SafeHandler(handler Handler) Handler

type Wrapper

type Wrapper interface {
	Unwrap() error
}

Jump to

Keyboard shortcuts

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