errors

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2025 License: GPL-3.0 Imports: 3 Imported by: 0

README

errors

Contains helper to wrap error by another error

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Combine

func Combine(errs ...error) (err error)

Combine receive multiple errors and return one

func New

func New(text string) error

New return new error

func Wrap

func Wrap(cause error, effect error) error

Wrap wrap error with error

func Wrapf

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

Wrapf wrap by format

Types

type MultipleError

type MultipleError struct {
	Cause  error
	Effect error
}

MultipleError type for wrap error around error

func (MultipleError) As

func (s MultipleError) As(target interface{}) bool

As finds the first error in err's chain that matches target, and if so, sets target to that error value and returns true. Otherwise, it returns false.

func (MultipleError) Error

func (s MultipleError) Error() string

Error return string based on error

func (MultipleError) Is

func (s MultipleError) Is(err error) bool

Is reports whether any error in err's chain matches target.

func (MultipleError) Unwrap

func (s MultipleError) Unwrap() error

Jump to

Keyboard shortcuts

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