errors

package
v0.0.0-...-9d0dce2 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2018 License: Apache-2.0 Imports: 2 Imported by: 0

README

AggregateError

AggregateError is an error structure used to aggregate multiple errors in a thread safe way.

Adding errors

var ae AggregateError
ae.Add(err)

Have errors been added?

var ae AggregateError
...
if ae.IsEmpty() {
    fmt.Println("No errors found")
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AggregateError

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

func (*AggregateError) Add

func (this *AggregateError) Add(err error) *AggregateError

Add adds given given error to my list of errors and returns this. If the given error is nil, nothing changes.

func (*AggregateError) AsError

func (this *AggregateError) AsError() error

AsError returns this instance if errors have been added to this instance, nil otherwise

func (*AggregateError) Error

func (this *AggregateError) Error() string

Error returns the combined error messages.

func (*AggregateError) IsEmpty

func (this *AggregateError) IsEmpty() bool

IsEmpty returns true if there are no errors added to me, false otherwise.

Jump to

Keyboard shortcuts

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