errors

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package errors provides utilities for annotating and combining errors.

Index

Constants

This section is empty.

Variables

View Source
var (
	New = errors.New
	Is  = errors.Is
	As  = errors.As
)

Aliases to the standard errors package.

Functions

func Combine

func Combine(errs ...error) error

Combine merges multiple errors into a single error, flattening any nested multi-errors.

func Details

func Details(err error) string

Details returns the detail annotations of err and its chain as a string.

func Errors

func Errors(err error) []error

Errors returns the individual errors from a combined error, or a single-element slice otherwise.

func WithCause

func WithCause(symptom, cause error) error

WithCause annotates a symptom error with a cause.

Both errors can be discovered by the Is and As methods.

func WithDetails

func WithDetails(err error, details ...string) error

WithDetails annotates an error with additional detail strings for diagnostics.

func WriteDetails

func WriteDetails(w io.Writer, err error)

WriteDetails writes the detail annotations of err and its chain to w.

Types

This section is empty.

Jump to

Keyboard shortcuts

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