util

package
v1.9.1 Latest Latest
Warning

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

Go to latest
Published: May 29, 2024 License: MIT Imports: 3 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ContextualizeIfNeeded added in v1.8.0

func ContextualizeIfNeeded(msg string, err error) error

ContextualizeIfNeeded is a helper function to turn an error into a ContextualError if it is not already one

func LogWithContextIfNeeded added in v1.8.0

func LogWithContextIfNeeded(msg string, err error, l *logrus.Logger)

LogWithContextIfNeeded is a helper function to log an error line for an error or ContextualError

Types

type ContextualError added in v1.5.1

type ContextualError struct {
	RealError error
	Fields    map[string]interface{}
	Context   string
}

func NewContextualError added in v1.5.1

func NewContextualError(msg string, fields map[string]interface{}, realError error) *ContextualError

func (*ContextualError) Error added in v1.5.1

func (ce *ContextualError) Error() string

func (*ContextualError) Log added in v1.5.1

func (ce *ContextualError) Log(lr *logrus.Logger)

func (*ContextualError) Unwrap added in v1.5.1

func (ce *ContextualError) Unwrap() error

Jump to

Keyboard shortcuts

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