terror

package
v0.0.0-...-41ddf2c Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EmptyCollection

func EmptyCollection(action string) terrors.TError

EmptyCollection creates a no values in collection error.

func InvalidArgCount

func InvalidArgCount(max, count int, usage string) terrors.TError

InvalidArgCount creates an invalid number of arguments error.

func New

func New(msg string, errs ...error) terrors.TError

New creates a new error with the given message and an optional error.

func NilArg

func NilArg(name string) terrors.TError

NilArg creates an invalid nil argument error.

func OutOfBounds

func OutOfBounds(index, count int) terrors.TError

OutOfBounds creates an index out of bounds error.

func RecoveredPanic

func RecoveredPanic(r any) terrors.TError

RecoveredPanic creates an error for a recovered panic.

func ToString

func ToString(err error) string

ToString constructs a long detailed string for the whole tree of errors following this error.

func UnstableIteration

func UnstableIteration() terrors.TError

UnstableIteration creates an error for when a collection is modified in a way that could make continuing any iteration for that collection unstable.

func Unwrap

func Unwrap(err error) []error

Unwrap will return all the errors wrapped in the given error.

Types

type Iterator

type Iterator[T any] interface {
	Next() bool
	Current() T
}

Iterator is a collection.Iterator.

func Walk

func Walk(err error) Iterator[error]

Walk returns an iterator function for walking through all the errors in the error tree in depth first order.

Jump to

Keyboard shortcuts

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