errors

package
v0.0.0-...-e03b028 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2024 License: Apache-2.0 Imports: 4 Imported by: 25

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrCritical = errors.New("criticl error")

Functions

func IsMetricViolationError

func IsMetricViolationError(err error) bool

IsMetricViolationError checks if given error is MetricViolation type.

func NewErrCritical

func NewErrCritical(err error) error

NewErrCritical wraps an error and marks it as fatal.

func NewMetricViolationError

func NewMetricViolationError(metric, reason string) error

NewMetricViolationError creates new metric violation error.

Types

type ErrorList

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

ErrorList is a thread-safe error list.

func NewErrorList

func NewErrorList(errors ...error) *ErrorList

NewErrorList creates new error list.

func (*ErrorList) Append

func (e *ErrorList) Append(errs ...error)

Append adds errors to the list

func (*ErrorList) Concat

func (e *ErrorList) Concat(e2 *ErrorList)

Concat concatenates error lists.

func (*ErrorList) Error

func (e *ErrorList) Error() string

Error returns string representation of ErrorList.

func (*ErrorList) Has

func (e *ErrorList) Has(targetErr error) bool

Has returns the first error in the list that is of the same type as the provided error. Equality is checked using `errors.Is`.

func (*ErrorList) IsEmpty

func (e *ErrorList) IsEmpty() bool

IsEmpty returns true if there is no error in the list.

func (*ErrorList) String

func (e *ErrorList) String() string

String returns error list as a single string.

Jump to

Keyboard shortcuts

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