errors

package
v0.6.5 Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

The errors package provides additional error primitives.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func As

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

func Is

func Is(err, target error) bool

func New

func New(text string) error

func Union

func Union(errs ...error) error

Union receives a number of errors and combines them into one Errors. Any errs that are Errors are concatenated directly. Returns nil if all errs are nil or empty.

func Unwrap

func Unwrap(err error) error

Types

type Errors

type Errors []error

Errors is a list of errors.

func (Errors) Append

func (errs Errors) Append(err ...error) Errors

Append returns errs with each err appended to it. Arguments that are nil are skipped.

func (Errors) Error

func (errs Errors) Error() string

Errors formats the list by separating each message with a newline. Each produced line, including lines within messages, is prefixed with a tab.

func (Errors) Return

func (errs Errors) Return() error

Return prepares errs to be returned by a function by returning nil if errs is empty.

Jump to

Keyboard shortcuts

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