errorutil

package
v1.5.1 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2022 License: CC0-1.0 Imports: 1 Imported by: 31

Documentation

Overview

Package errorutil contains common error objects and functions.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AssertOk

func AssertOk(err error)

AssertOk will panic on any non-nil error parameter.

func AssertTrue

func AssertTrue(condition bool, errString string)

AssertTrue will panic if the given condition is negative.

Types

type CompositeError

type CompositeError struct {
	Errors []error
}

CompositeError can collect multiple errors in a single error object.

func NewCompositeError

func NewCompositeError() *CompositeError

NewCompositeError creates a new composite error object.

func (*CompositeError) Add

func (ce *CompositeError) Add(e error)

Add adds an error.

func (*CompositeError) Error

func (ce *CompositeError) Error() string

Error returns all collected errors as a string.

func (*CompositeError) HasErrors

func (ce *CompositeError) HasErrors() bool

HasErrors returns true if any error have been collected.

Jump to

Keyboard shortcuts

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