errors

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: May 8, 2026 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 WrapBoundary added in v1.1.0

func WrapBoundary(kind string, operation string, err error) error

WrapBoundary returns nil for nil errors or a BoundaryError for non-nil errors.

func Wrapf

func Wrapf(err error, format string, args ...any) error

Wrapf wrap by format

Types

type BoundaryError added in v1.1.0

type BoundaryError struct {
	Kind      string
	Operation string
	Err       error
}

BoundaryError wraps an infrastructure or SDK error at a core-owned package boundary.

func (BoundaryError) Error added in v1.1.0

func (e BoundaryError) Error() string

Error returns the boundary error message.

func (BoundaryError) Unwrap added in v1.1.0

func (e BoundaryError) Unwrap() error

Unwrap returns the wrapped SDK or infrastructure error.

type MultipleError

type MultipleError struct {
	Cause  error
	Effect error
}

MultipleError type for wrap error around error

func (MultipleError) As

func (s MultipleError) As(target any) 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