Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FormatChain ¶
FormatChain formats a dependency chain for error messages. This is useful for displaying the full chain of missing dependencies. Depth is capped at maxFormatChainDepth to prevent stack overflow on cyclic chains; subsequent links are replaced with "<truncated>".
Types ¶
type ChainableError ¶
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.