errutils

package
v1.2.7 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2025 License: MIT Imports: 5 Imported by: 2

README

write readme for errutils package

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CustomError added in v1.2.3

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

CustomError is a struct that holds a template for creating custom errors. The template is a string that can contain format verbs.

func NewCustomError added in v1.2.3

func NewCustomError(template string) *CustomError

NewCustomError creates a new CustomError with the given template.

func (*CustomError) Err added in v1.2.3

func (e *CustomError) Err(params ...any) error

Err creates a new error using the template and the parameters.

type MultiError

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

func NewMultiErr

func NewMultiErr(err error) (multiErr *MultiError)

NewMultiErr creates a new MultiError and adds the given error to it.

func (*MultiError) Add

func (m *MultiError) Add(err error)

Add adds an error to the MultiError. If the error is nil, it is not added.

func (*MultiError) Error

func (m *MultiError) Error() string

Error function implements the error.Error function of the error interface

func (*MultiError) GetAll

func (m *MultiError) GetAll() (errs []error)

GetAll returns all the errors in the MultiError.

func (*MultiError) HasError

func (m *MultiError) HasError(err error) bool

HasError will return true if the MultiError has any errors of the specified type

func (*MultiError) HasErrors added in v1.0.5

func (m *MultiError) HasErrors() bool

HasErrors will return true if the MultiError has any errors

Jump to

Keyboard shortcuts

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