Documentation
¶
Index ¶
- func Append(errs error, coords hasCoordinates, reason error) error
- func Appendf(errs error, coords hasCoordinates, format string, args ...any) error
- func IfEmptyf[T any](emptyTest []T, format string, args ...any) error
- func Join(errs ...error) error
- func Joinf(errs error, format string, args ...any) error
- func ProcessPathErrors(err error) error
- type CoordinateError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Append ¶
Append returns an error joined to the first error/set of errors, with a new CoordinateError appended to the end
func Appendf ¶
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 ¶
IfEmptyf returns a new Errorf-formatted error, only when the provided slice is empty or nil when the slice has entries
func Join ¶
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 ¶
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
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