errors

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: May 16, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FormatChain

func FormatChain(dep, requiredBy string, cause error, indent string) string

FormatChain formats a dependency chain for error messages. This is useful for displaying the full chain of missing dependencies.

Types

type ChainableError

type ChainableError struct {
	Type       string
	RequiredBy string
	Cause      error
}

ChainableError represents an error with a dependency chain. This is useful for tracking the full path of errors through a call stack.

func NewChainableError

func NewChainableError(typ string, cause error) *ChainableError

NewChainableError creates a new chainable error with the given type and cause.

func (*ChainableError) Error

func (e *ChainableError) Error() string

Error returns a formatted error message showing the full chain.

func (*ChainableError) Unwrap

func (e *ChainableError) Unwrap() error

Unwrap returns the underlying cause for use with errors.Is/As.

func (*ChainableError) WithRequiredBy

func (e *ChainableError) WithRequiredBy(requiredBy string) *ChainableError

WithRequiredBy adds the required-by context to a chainable error.

Jump to

Keyboard shortcuts

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