errors

package
v0.0.0-...-0c2e2dc Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2025 License: BSD-3-Clause Imports: 1 Imported by: 11

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LogFatal

func LogFatal(errs ...error)

LogFatal does a log.Fata if any error is non-nil.

func Panic

func Panic(errs ...error)

Panic panics if any error is non-nil.

Types

type Block

type Block interface {
	AddError(error)
	HasError() bool
}

Block tracks one or more errors.

type FirstBlock

type FirstBlock struct {
	Err error
}

FirstBlock is a Block that stores the first error it receives.

func (*FirstBlock) AddError

func (c *FirstBlock) AddError(e error)

func (*FirstBlock) HasError

func (c *FirstBlock) HasError() bool

type NullBlock

type NullBlock struct {
}

NullBlock is an empty Block that doesn't store errors.

func (*NullBlock) AddError

func (c *NullBlock) AddError(e error)

func (*NullBlock) HasError

func (c *NullBlock) HasError() bool

type SliceBlock

type SliceBlock struct {
	Errs []error
}

SliceBlock is a Block that stores the multiple errors.

func (*SliceBlock) AddError

func (c *SliceBlock) AddError(e error)

func (*SliceBlock) HasError

func (c *SliceBlock) HasError() bool

Jump to

Keyboard shortcuts

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