cerr

package
v0.6.10-0...-926069d Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2023 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Log

func Log(err error)

Types

type ContextualError

type ContextualError struct {
	Context ErrorContext
	Msg     string
}

func Error

func Error(msg string) ContextualError

func (ContextualError) Error

func (c ContextualError) Error() string

func (ContextualError) Fields

func (c ContextualError) Fields() map[string]any

func (ContextualError) String

func (c ContextualError) String() string

func (ContextualError) Unwrap

func (c ContextualError) Unwrap() error

type ErrorContext

type ErrorContext struct {
	ContextFields map[string]any
	WrappedError  error
}

func Field

func Field(key string, value any) *ErrorContext

func Fields

func Fields(fields F) *ErrorContext

func Wrap

func Wrap(err error) *ErrorContext

func (ErrorContext) Clone

func (e ErrorContext) Clone() ErrorContext

func (ErrorContext) Error

func (e ErrorContext) Error(msg string) ContextualError

func (*ErrorContext) Field

func (e *ErrorContext) Field(key string, value any) *ErrorContext

func (*ErrorContext) Fields

func (e *ErrorContext) Fields(fields F) *ErrorContext

func (*ErrorContext) Wrap

func (e *ErrorContext) Wrap(err error) *ErrorContext

type F

type F map[string]any

type Fielder

type Fielder interface {
	Fields() map[string]any
}

Jump to

Keyboard shortcuts

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