errutils

package
v1.32.0 Latest Latest
Warning

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

Go to latest
Published: May 14, 2026 License: MIT Imports: 2 Imported by: 0

README

Errors (errutils)

  • NewErrorAggregator: Creates a new error aggregator to collect multiple errors.
  • Add: Adds an error to the aggregator.
  • Error: Retrieves the aggregated error message.
  • HasErrors: Checks if there are any errors in the aggregator.

Examples:

For examples of each function, please checkout EXAMPLES.md


Documentation

Overview

Package errutils provides utilities for error aggregation and handling.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ErrorAggregator

type ErrorAggregator struct {
	// contains filtered or unexported fields
}

ErrorAggregator aggregates multiple errors into a single error.

func NewErrorAggregator

func NewErrorAggregator() *ErrorAggregator

NewErrorAggregator creates a new instance of ErrorAggregator.

func (*ErrorAggregator) Add

func (e *ErrorAggregator) Add(err error)

Add adds a new error to the aggregator. If err is nil, it is ignored.

func (*ErrorAggregator) Error

func (e *ErrorAggregator) Error() error

Error returns the aggregated errors as a single error message. If there are no errors, it returns nil.

func (*ErrorAggregator) ErrorList

func (e *ErrorAggregator) ErrorList() []error

ErrorList returns the list of aggregated errors as a slice.

func (*ErrorAggregator) HasErrors

func (e *ErrorAggregator) HasErrors() bool

HasErrors returns true if there are any aggregated errors.

Jump to

Keyboard shortcuts

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