errors

package
v0.36.1 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2024 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Is

func Is[T error](err error) bool

Is checks if the error is a (wrapped) error of the given type

func KeyVals

func KeyVals(err error) []interface{}

KeyVals returns key values if error is a (wrapped) ErrWithKeyVals, nil otherwise

Types

type ErrWithKeyVals

type ErrWithKeyVals interface {
	error
	KeyVals() []interface{}
	With(keyvals ...interface{}) ErrWithKeyVals
}

ErrWithKeyVals is an error with additional capabilities for easier logging

func With

func With(err error, keyvals ...interface{}) ErrWithKeyVals

With returns an error with attached key values for logging

Jump to

Keyboard shortcuts

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