errors

package
v0.82.0 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2023 License: Apache-2.0 Imports: 4 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AgentError

type AgentError struct {
	Description string
	Suggestion  string
	Details     ErrorDetails
}

AgentError is an error that occurs in the agent.

func NewError

func NewError(description string, suggestion string, keyValues ...string) AgentError

NewError will create a new agent error.

func WithDetails

func WithDetails(err error, keyValues ...string) AgentError

WithDetails will add details to an agent error

func Wrap

func Wrap(err error, context string) AgentError

Wrap adds context to the description for richer logs

func (AgentError) Error

func (e AgentError) Error() string

Error will return the error message.

func (AgentError) MarshalLogObject

func (e AgentError) MarshalLogObject(encoder zapcore.ObjectEncoder) error

MarshalLogObject will define the representation of this error when logging.

func (AgentError) WithDetails

func (e AgentError) WithDetails(keyValues ...string) AgentError

WithDetails will return the error with additional details

type ErrorDetails

type ErrorDetails map[string]string

ErrorDetails is a map of details for an agent error.

func (ErrorDetails) MarshalLogObject

func (d ErrorDetails) MarshalLogObject(encoder zapcore.ObjectEncoder) error

MarshalLogObject will define the representation of details when logging.

Jump to

Keyboard shortcuts

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