unknown

package
v1.31.0 Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2025 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Append

func Append(errs error, coords hasCoordinates, reason error) error

Append returns an error joined to the first error/set of errors, with a new CoordinateError appended to the end

func Appendf

func Appendf(errs error, coords hasCoordinates, format string, args ...any) error

Appendf returns an error joined to the first error/set of errors, with a new CoordinateError appended to the end, created from the given reason and args

func IfEmptyf

func IfEmptyf[T any](emptyTest []T, format string, args ...any) error

IfEmptyf returns a new Errorf-formatted error, only when the provided slice is empty or nil when the slice has entries

func Join

func Join(errs ...error) error

Join joins the provided sets of errors together in a flattened manner, taking into account nested errors created from other sources, including errors.Join, multierror.Append, and unknown.Join

func Joinf

func Joinf(errs error, format string, args ...any) error

Joinf joins the provided sets of errors together in a flattened manner, taking into account nested errors created from other sources, including errors.Join, multierror.Append, and unknown.Join and appending a new error, created from the format and args provided -- the error is NOT a CoordinateError

func ProcessPathErrors added in v1.16.0

func ProcessPathErrors(err error) error

ProcessPathErrors replaces "path" errors returned from the file.Resolver into unknowns, and warn logs non-unknown errors, returning only the unknown errors

Types

type CoordinateError

type CoordinateError struct {
	Coordinates file.Coordinates
	Reason      error
}

func ExtractCoordinateErrors

func ExtractCoordinateErrors(err error) (coordinateErrors []CoordinateError, remainingErrors error)

ExtractCoordinateErrors extracts all coordinate errors returned, and any _additional_ errors in the graph are encapsulated in the second, error return parameter

func New

func New(coords hasCoordinates, reason error) *CoordinateError

New returns a new CoordinateError unless the reason is a CoordinateError itself, in which case reason will be returned directly or if reason is nil, nil will be returned

func Newf

func Newf(coords hasCoordinates, format string, args ...any) *CoordinateError

Newf returns a new CoordinateError with a reason of an error created from given format and args

func (*CoordinateError) Error

func (u *CoordinateError) Error() string

Jump to

Keyboard shortcuts

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