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.
Click to show internal directories.
Click to hide internal directories.