errors

package
v0.100.0 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2025 License: Apache-2.0 Imports: 6 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetRootStack

func GetRootStack(err error) string

GetRootStack will recurse through an error until it finds one with a stack string set.

func LogError

func LogError(ctx context.Context, err *ClowderError)

LogError logs an error using the given contexts logger and a string.

Types

type ClowdKey

type ClowdKey string

ClowdKey is a string determining the type of error.

type ClowderError

type ClowderError struct {
	Stack   zap.Field
	Msg     string
	Cause   error
	Requeue bool
}

ClowderError is a Clowder specific error, it has a number of functions attached to it to allow for creation and checking.

func NewClowderError added in v0.53.0

func NewClowderError(msg string) *ClowderError

NewClowderError constructs a new ClowderError object.

func Wrap

func Wrap(msg string, err error) *ClowderError

Wrap takes an existing error an wraps it, returning a ClowderError

func (*ClowderError) Error

func (a *ClowderError) Error() string

func (*ClowderError) Is

func (a *ClowderError) Is(target error) bool

Is checks that a target is the same as a given error, that is, it has the same message and cause.

func (*ClowderError) Unwrap

func (a *ClowderError) Unwrap() error

type MissingDependencies

type MissingDependencies struct {
	MissingDeps []MissingDependency
}

MissingDependencies is a struct that holds a list of MissingDependency structs

func MakeMissingDependencies added in v0.50.0

func MakeMissingDependencies(missingDep MissingDependency) MissingDependencies

func (*MissingDependencies) Error

func (e *MissingDependencies) Error() string

Error returns a string representation of the missing dependencies

type MissingDependency added in v0.50.0

type MissingDependency struct {
	Source  string
	Details string
}

MissingDependency is a struct that holds information about a missing dependency

func (*MissingDependency) ToString added in v0.50.0

func (m *MissingDependency) ToString() string

ToString returns a string representation of the missing dependency

Jump to

Keyboard shortcuts

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