errors

package module
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2021 License: MIT Imports: 6 Imported by: 23

README

errors

errors stuff

Build Status

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func As

func As(err error, target interface{}) bool

As stdlib errors.As wrapper

func Is

func Is(err, target error) bool

Is stdlib errors.Is wrapper

func New

func New(reason string) error

func Newf

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

func Wrap

func Wrap(err error, reason string) error

func Wrapf

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

Types

type Chain

type Chain []error

Chain - цепочка ошибок

func (Chain) As

func (ch Chain) As(target interface{}) bool

func (Chain) Error

func (ch Chain) Error() string

func (Chain) Is

func (ch Chain) Is(err error) bool

type Const

type Const string

Const тип используемый для константных ошибок, позволяет избегать возможных мутаций значений ошибок.

func (Const) Error

func (e Const) Error() string

type CustomError

type CustomError interface {
	Just(err error) error
	New(reason string) error
	Newf(format string, args ...interface{}) error
	Wrap(err error, reason string) error
	Wrapf(err error, format string, args ...interface{}) error
	fields.FieldContainer
}

func Builder

func Builder() CustomError

Jump to

Keyboard shortcuts

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